You need to show the list of all country names available in the TopUni.csv file in the order that they appear in the file. Each country name should be displayed only once without repetition. The names should be in upper case. Country names are separated by a comma and a space after it. The output should be as follows: Available countries => COUNTRY1, COUNTRY2, COUNTRY3, where COUNTRY1, COUNTRY2, COUNTRY3, should be replaced by the list of all country names. If the printed list of countries end with a comma and a space, that is fine. The following is an example output: E output.txt Available countries => USA, UNITED KINGDOM, JAPAN, FRANCE, CANADA, SWITZERLAND,
Q: . Distinguish between the following terms. Please write your answers for each: (a) Objects and…
A: In the given question Object-oriented programming refers to the concept in high-level languages such…
Q: How would you use a firewall to protect your home network?
A: Introduction: A home firewall protects networked devices against cyberattacks. Check your router's…
Q: It's important to clarify the distinctions between FDM and TDM. Please provide a one-page report.
A: Multiplexing:- Multiplexing is the process of the combining multiple signals transmitted over a…
Q: Is the language composed of all strings over the alphabet {a,b} that contain an odd number of a's a…
A: Here in this question we have asked that a language composed of all strings over the alphabet {a,b}…
Q: What is dynamic scoping, when and why would you use it, and how can you make it run as slowly as…
A: The answer is given in the following step for your reference.
Q: I was wondering how modern network programs deal with many connections
A: When I began advising, my little web-startup customers would always ask me what sort of powerful…
Q: . Discuss the significance of design patterns in the creation of object-oriented software.
A: Design Pattern:- A design pattern provides a general reusable solution for the common problems that…
Q: In this project, you will develop algorithms that find road routes through the bridges to travel…
A: Description: A text file containing information on the supplied map serves as the input. Each file…
Q: 6. Analysis Answer the following questions: 1. Given the following array declaration: int array1…
A: The solution is provided below.
Q: What does it do and how does one set one up?
A: Explanation: Monitoring and controlling the flow of traffic over a network are two of the purposes…
Q: F 3 val digit 1 lexval T 9 val inh 5 T 8 syn F 4 val digit 2 lexval D inh 6 T 7 syn € Figure 5.7:…
A: It is a linear ordering of its vertices such that for every directed edge MN for vertex M to N, M…
Q: Filter programmes such as sed and awk are widely used to format data in pipelines. Is this statement…
A: awk command is a useful and powerful command used for pattern matching as well as for text…
Q: The language composed of all strings over the alphabet {a,b} of the form: zero or more a's followed…
A: Introduction: It contains all the strings over the alphabet {a, b}: Zero or more a's followed by…
Q: Answer the following questions: a) Describe the difference between lossy and lossless compression.…
A: a) Answers:- The Data Compression is a the technique in which the size of the data is reduced…
Q: What is the computational complexity of estimating accuracy and variance for an unpruned…
A: The computational difficulty of a complete jackknife is as follows: A more accurate estimation of…
Q: The following method is designed to count the number of zeros in an array. public int…
A: The program is written in Java. Check the program screenshot for the correct indentation. Please…
Q: What are the distinctions between the Internet email protocols of SMTP, POP, and IMAP? Describe how…
A: Introduction: SMTP sends messages from the sender's email client to the receiver's email server and…
Q: Is there any way to test whether your email will stop working if you transfer ISPs?
A: There is no one definitive answer to this question, as it depends on a number of factors including…
Q: Consider the essential features that your operating system would provide if you were to create one.…
A: Answer is
Q: TCP/function: what does it stand for? IP's
A: Transmission Control Protocol : Transmission Control Protocol and Internet Protocol are both…
Q: What's the Difference Between Trying to Prevent a Deadlock and Trying to Avoid One?
A: Introduction: A deadlock is a scenario that arises when a set of processes, each of which possesses…
Q: The stack data type derives it's name from the facts that it resembles a stack of real-world…
A: Answer is
Q: Student_ID: int Grades[5]: int + setgrades: void + setID: int
A: I have written code below:
Q: Write a user-friendly python program where the code will ask the user a polynomial function. Then,…
A: Python code that uses the Newton-Raphson method to locate the fundamental point of a polynomial…
Q: Implement a Result Compilation System for CP Course. Program will take Marks of 3 Quizzes, 2…
A: Answer is given in Python along with output and code screenshots
Q: Write a program using integers user_num and x as input, and output user num divided by x three times…
A: Use of Python in web development:- Sending data to and from servers, processing data and interacting…
Q: It’s the end of class, and like all 5 year old students, it is customary for them to greet their…
A: The required javascript code is as follows // the good bye programconsole.log('goodbye and thank…
Q: The capabilities of an embedded system are not the same as those of a regular computer. Embedded…
A: Introduction: This investigation will focus on determining the differences and similarities between…
Q: How would you use a firewall to protect your home network?
A: Introduction: The answer to the query is that a home firewall protects connected devices from…
Q: 9 10 11 12 13 A B D E F H J You are analyzing the budget overrun for the activities; this analysis…
A: Let's see the answer:
Q: The limitations of the Tor network are as follows.
A: Tor is a great tool for web anonymity as long as you ONLY use their recommended methods and…
Q: ABET 2) Construct a regular expression corresponding to the following set: {binary strings such that…
A: Here in this question we have asked to Construct a regular expression corresponding to the following…
Q: What is the recurrence relation of maximum subarray sum problem by using Divide and Conquer approach…
A: A recurrence relation is an equation that recursively defines a sequence where the next term is a…
Q: How many specific steps (6 total) in the paper mill's process result in the finalized design?
A: Introduction: Each processor in the chain will have its own implementation for processing a command.…
Q: When talking about WiFi, what exactly does it mean to say that there is a "Access Point"? Can you…
A: "Access Point" In the context of WiFi, what does the phrase "Access Point" mean? Do you know what…
Q: Look at where you fit in the value chain. How does the value chain work? What do you do? How do you…
A: Introduction: The value chain consists of a number of processes that are utilised to convert input…
Q: What benefits and drawbacks are associated with disc write caching?
A: Disc writes caching: the practise of maintaining files in a temporary storage area so that the user…
Q: 1.21 LAB: Divide by x Write a program using integers user_num and x as input, and output user_num…
A: The above question is solved in step 2 :-
Q: How can the individual nodes in an Ad Hoc Network detect a change in the network's topology?
A: An Ad-hoc network is a temporary Local Area Network (LAN) type. If we want to permanently set up an…
Q: 2. How are data and methods organized in an object-oriented program? 3. Describe inheritance as…
A: According to the information given:- We have to define data and methods organized, inheritance as…
Q: How does wavelength division multiplexing (WDM) really function
A: By varying the dynamic length of laser light, wavelength division multiplexing (WDM) is a technique…
Q: How can the nodes of an Adhoc Network detect a change in the network's topology?
A: How can the nodes of an Ad-hoc Network detect a change in the Network topology A wireless ad hoc…
Q: Let n be the number of keys, and m be the size of the hash table. Show that if n > m, the collision…
A: Hash Table: An associative data structure called a hash table is used to store data. Each data value…
Q: Mouses that detect mouse movement using an optical sensor.
A: Given: In order to track the movement of the mouse, an optical mouse employs the usage of an optical…
Q: Given the availability of on-chip L3 caches, compare the advantages and disadvantages of shared vs.…
A: Solution- The term "single-threaded" describes how we create a single connection and measure the…
Q: We suggest raising Flynn's taxonomy by one degree. Why are more advanced computers better than less…
A: Flynn's taxonomy's widespread acceptance is attributed to two things. These include: how many…
Q: Web servers are crucial to the operation of the Internet, but what are they and what do they…
A: Let's first see about web servers before knowing the importance of it for internet. Web servers In…
Q: What makes NoSQL databases unique?
A: Introduction: Massive amounts of unstructured data may be stored, processed, and analysed using…
Q: a. Provides a login capability and account creation b. Allows teachers to post homework to…
A: For testing the Web Application one need to check the following six steps:- 1.Functionality…
Q: Think about why "sudo" access is provided. What is the benefit of not logging in as root?
A: The "Sudo" command grants root privileges to a current user account. The permission is temporary…
hi there, i am struggling with creating a script that will read through a CSV file and print the country names without repeating a given name like the pictured example. ill share my code below but i am unsure if i need to create a list of how to spilt the so that only names will generate to print ex - country1, country2, country3, etc
with open('TopUni.csv', 'r') as csv_file:
csvReader = csv.reader(csv_file)
COUNTRYLIST = []
line = fileOne.readline()
while line != "":
countryName = line.rstrip()
line = fileOne.readline()
population = str(line)
print(line)
line = fileOne.readline()
Step by step
Solved in 3 steps with 2 images
- In the student sample program files for this chapter, you will find a text file namedGasPrices.txt. The file contains the weekly average prices for a gallon of gas in the UnitedStates, beginning on April 5th, 1993, and ending on August 26th, 2013. Figure 8-7 shows anexample of the first few lines of the file’s contents:Figure 8-7 The GasPrices.txt fileDescriptionEach line in the file contains the average price for a gallon of gas on a specific date. Each line isformatted in the following way:MM-DD-YYYY:PriceMM is the two-digit month, DD is the two-digit day, and YYYY is the four-digit year. Price is theaverage price per gallon of gas on the specified date.For this assignment, you are to write one or more programs that read the contents of the file andperform the following calculations:Average Price Per Year: Calculate the average price of gas per year, for each year in thefile. (The file’s data starts in April of 1993, and it ends in August 2013. Use the data that ispresent for the…You are given a file which has an Australian state name and a university name in each line. You can view the file as follows. DO NOT CHANGE the content of the uni.txt (otherwise you will have to press the triple dot button at the top-right and then "Reset to Scaffold"). sorter.py uni.txt + uni.txt 1 NSW USYD 2 NSW UNSW 3 ACT ANU 4 WA UWA 5 QLD UQ 6 VIC UMEL 7 VIC MONASH_U 8 SA ADELAIDE_U Write a program sorter.py that 1) reads a command line argument containing the file to open, 2) opens and reads the file, 3) extracts each Australian state (not the university), i.e. the first word token in each line, and 4) sorts the states in alphabetical order. You may assume that each state is one word long. Furthermore, make sure to only record the names of unique states - so do not record any state twice. HINT: use the in keyword. E.g. ▸ Run 1 ls = [1, 2 if 4 in ls: 3 4 elif 4 not in ls: 2, 3] print("4 is in list") 5 print("4 is NOT in list") PYTHON You MUST use open(), read(), split(), sort(),…BASH FLOW CHART: Create a flow chart to describe an algorithm that takes a text file with format ID,FirstName,Last Name,Street,City and appends a user ID field consisting of a C followed by theemployee ID. For example, the first entries in Lab 2's employees.txt are:0,Douglas L,Eberhard,Addenda Circle,Cornwall1,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough2,Bailey Rae,Lopez,Turnagain Street,Sault Ste. MarieAfter processing, the entries should be:0,Douglas L,Eberhard,Addenda Circle,Cornwall,C01,Elizabeth Sua,Hemauer,Wyatt Way,Peterborough,C12,Bailey Rae,Lopez,Turnagain Street,Sault Ste. Marie,C2
- "In the student sample program files for this chapter, you will find a text file named house_prices.csv. The file contains the following data about houses for sale in a city: Price Number of bedrooms Number of bathrooms Square feet of living space The data stored in each line is formatted in the following way: Price,Bedrooms,Bathrooms,SquareFeet Notice that the data items are separated by commas. The first line in the file looks like this: 221900,3,1,1180 The data stored in this line is: Price = $221,900 Bedrooms = 3 Bathrooms = 1 Square feet = 1,180 Design a class that has properties for the four pieces of data. In an application, read the file and store each house’s data in an instance of the class. The class instances should be stored in a List. The application should let the user search the List for the prices of houses with the number of bedrooms within a range, the number of bathrooms within a range, and the square feet of living space within a range. For…R-Studio 1.) You have an airport routes.csv file that contains 3409 airports, each row has a 3-letter code and the number of routes. Example: Airport NumberOfRoutes AAE 9 AAL 20 AAN 2 AAQ 3 AAR 8 AAT 2 AAX 1 AAY 1 ABA 4 ABB 2 ABD 6 ABE 13 ABI 2 ABJ 49 ABL 4 ABM 1 ABQ 42 ABR 1 ABS 1 ABT 3 ABV 30 ABX 4 ABY 4 ABZ 41 ACA 8 ACC 54 ACE 116 ACH 2 ACI 2 ACK 6 ACR 2 ACT 2 ACU 1 ACV 3 ACX 6 ACY 10 ACZ 1 ADA 17 ADB 66 ADD 105 ADE 23 ADF 2 ADK 1 ADL 51 ADQ 11 ADU 3 ADZ 11 AEB 3 AEP 65 For this dataset, consider the following models:(a) Suppose the given data points follow a power law distribution. Estimate the corresponding α parameter. (b) Suppose the given data points follow an exponential distribution. Estimate the corresponding λ parameter. (c) Suppose the given data points follow a uniform distribution. Estimate the corresponding range parameters [a, b] of the uniform distribution.(d)…In the attached city list.txt file, the names of the provinces in Turkey are given in a single line according to the format given in Figure 1. In the application you will write, write the city names read from this file into the license plate list.txt file in the format shown in Figure 2. In more descriptive terms, citylist.txt is a file given to you. license plate list.txt is the file you will get with your code. city list: Adana, Adıyaman, Afyon, Ağrı, Amasya, Ankara, Antalya, Artvin, Aydın, Balıkesir, Bilecik, Bingöl, Bitlis, Bolu, Burdur, Bursa, Çanakkale, Çankırı, Çorum, Denizli, Diyarbakır, Edirne, Elazığ, Erzincan, Erzurum, Eskişehir, Gaziantep, Giresun, Gümüşhane, Hakkari, Hatay, Isparta, İçel (Mersin), İstanbul, İzmir, Kars, Kastamonu, Kayseri, Kırklareli, Kırşehir, Kocaeli, Konya, Kütahya, Malatya, Manisa, Kahramanmaraş, Mardin, Muğla, Muş, Nevşehir, Niğde, Ordu, Rize, Sakarya, Samsun, Siirt, Sinop, Sivas, Tekirdağ, Tokat, Trabzon, Tunceli, Şanlıurfa, Uşak, Van, Yozgat,…
- File names: color_square.py, chessboard.py, test_squares.py Positions on a chess board are identified by a letter and a number. The letter identifies the column; the number identifies the row. See the image below. You will provide the functions that allow us to determine: if a chessboard square is either black or white, given its coordinates. If the row/column is valid or not for the standard chessboard For example, if we pass in “d” for the column and 4 for the row, your function that determines color should return the string: “BLACK”. If we pass in "k" for the column to your function that validates columns, that function should return the boolean False. Requirements: Your function for validating the column should be able to accept upper or lowercase strings as parameters. Your functions for validating the row should be able to accept integers or strings as parameters. Your function that determines black-or-white may assume that the input has been validated prior to us calling…In the input file (see image), grades are listed for the geography tests of group 2b. There have been three tests of which the grades will be included in the half-yearly report that is given to the students before the Christmas break. On each line of the input you can find the name of the student, followed by one or more under scores (’_’). These are succeeded by the grades for the tests, for example: Anne Adema____________6.5 5.5 4.5Bea de Bruin__________6.7 7.2 7.7Chris Cohen___________6.8 7.8 7.3Dirk Dirksen__________1.0 5.0 7.7 The lowest grade possible is a 1, the highest a 10. If somebody missed a test, the grade on the list is a 1. The assignment is to make the report for the geography course of group 2b, which should look like this: Report for group 2bAnne Adema has an average grade of 5.5Bea de Bruin has an average grade of 7.2Chris Cohen has an average grade of 7.3Dirk Dirksen has an average grade of 4.6End of report Use functions to structure the code in Python.>> classicVinyls.cpp For the following program, you will use the text file called “vinyls.txt” attached to this assignment. The file stores information about a collection of classic vinyls. The records in the file are like the ones on the following sample: Led_Zeppelin Led_Zeppelin 1969 1000.00 The_Prettiest_Star David_Bowie 1973 2000.00 Speedway Elvis_Presley 1968 5000.00 Spirit_in_the_Night Bruce_Springsteen 1973 5000.00 … Write a declaration for a structure named vinylRec that is to be used to store the records for the classic collection system. The fields in the record should include a title (string), an artist (string), the yearReleased (int), and an estimatedPrice(double). Create the following…
- The names and student numbers of students are save in a text file called stnumbers.txt. Example of the content of the text file: Peterson 20570856 Johnson 12345678 Suku 87654321 Westley 12345678 Venter 87654321 Mokoena 79012400 Makubela 29813360 Botha 30489059 Bradley 30350069 Manana 30530679 Shabalala 28863496 Smith 87873909 Nilsson 30989698 Makwela 30256607 Govender 30048117 Ntumba 30598303 Ramsamy 29952239 Skosana 29982995 Jameson 30228484 Xulu 29092248 Wasserman 27469352 Bester 28615425 Babane 27154033 Maboya 29897890 Mahlangu 30031338 Majavu 30165970 Myene 30954177 Motaung 30907276 Ramaroka 30804507 Radebe 30007674 Sekake 30017416 Zwane 30038227 Shuro 30238072 Viljoen 28881389 Sithole 45688555 Write a function called displayData() to receive the array and number of elements as parameters and display the names and student numbers of the students with a heading and neatly spaced. Write a function, isValid(), which receives a number as parameter and determines whether the number…The Apgar Medical group keeps a patient file for each doctor in the office. Each record contains the patient's first and last name, home address, and birth year. The records are sorted in ascending birth year order. Write a program so that display a count of the number of patients born each year John Hanson, 23 Elm, 1927Mary Locust, 476 Maple, 1950Susan Monroe, 512 Peachtree, 1957Carol Fortune, 2819 Locust, 1960James Fortune, 2819 Locust, 1963Lawrence Fish, 12 Elm, 1968Janice Weiss, 234 Birch, 1971Henry Garza, 199 Second, 1973Kimberly Swanson, 310 Appletree, 1980Louis Claude, 2716 Third, 1981Jill Fox, 12 Oak, 1985Opal Reynolds, 78 County Line, 1987Francis Dumas, 67 Fourth, 1992Madison Conroy, 23 Fifth, 1996Daniel Moy, 100 Sunset, 1987Cargo Container Report. You will be producing a program which will allow the user to generate the container report on the following page in Container Number order or Ship Name order. The program will also the user to lookup the data for any given Container by number. The % cargo weight is the percentage of the cargo of the gross weight (cargo weight/gross weight), % total is the percentage of the cargo for that container of the total amount of cargo unloaded (cargo weight for the container / total cargo unloaded. Hint: you are expected to use methods for your calculations. The accompanying file has the data for the containers unloaded today. The data includes container number int ship name. String tare weight of the container (empty weight) int the gross weight (container plus the cargo). Int You will need to computer the cargo weight as the gross weight minus the tare weight. If you have issues reading the data with the String, you may remove the String. However, you will lose points.…