Write a program named lastname_firstname_cities.py that works with information about large cities. Your program will open the cities.txt downloadfile. Each line in the file has the name of a city, its country, and its population. The first few lines of the file look like this:

Answers

Answer 1

Answer and Explanation:

Open your text editor and open new file. Save new file file as lastname_firstname_cities.py. The program will open the file cities.txt downloadfile hence :

dfile= open(cities.txt, "r")

If we write this into our lastname_firstname_cities.py file it will open our cities.txt downloadfile in read mode and text mode(by default unless we specify binary mode which is for images)


Related Questions

please give me correct answer

please give me very short answer​

Answers

Answer:

1.A table is a range of data that is defined and named in a particular way.

2.Table tools and layout

3.In insert tab Select the table and select the number of rows and colums

4.Split cell is use to split the data of a cell.Merge cell is used to combine a row or column of cells.

5.Select the cell and click down arrow next to the border button.

You are going to purchase (2) items from an online store.
If you spend $100 or more, you will get a 10% discount on your total purchase.
If you spend between $50 and $100, you will get a 5% discount on your total purchase.
If you spend less than $50, you will get no discount.
Givens:
Cost of First Item (in $)
Cost of Second Item (in $)
Result To Print Out:
"Your total purchase is $X." or "Your total purchase is $X, which includes your X% discount."

Answers

Answer:

Code:-

using System;

using System.Collections.Generic;

class MainClass {

public static void Main (string[] args) {

int Val1,Val2,total;

string input;

double overall;

Console.Write("Cost of First Item (in $)");

      input = Console.ReadLine();

Val1 = Convert.ToInt32(input);

Console.Write("Cost of Second Item (in $)");

      input = Console.ReadLine();

Val2 = Convert.ToInt32(input);

total=Val1+Val2;

if (total >= 100)

{

overall=.9*total;

Console.WriteLine("Your total purchase is $"+overall);

}

else if (total >= 50 & total < 100)

{

overall=.95*total;

Console.WriteLine("Your total purchase is $"+overall);

}  

else

{

Console.WriteLine("Your total purchase is $"+total);

}  

}

}

Output:

hi, please help me.solution.​

Answers

Answer:

aahdbdnsjajaissjdjdhskakwjdhbebs


Calculator is an example of
computer
A. analogue
B. hybrid
C. manual
D. digital
E. public​

Answers

D. digital

Explanation:

I hope it helps you

25. Các phát biểu nào sau, phát biểu nào là đúng:
- tên file không được chứa khoảng trắng
- tên file không nên có dấu tiếng viết
- tên file được dài trên 255 ký tự
- tên file được chấp nhận ký tự khác

Answers


-tên file được chấp nhận ký tự khác

Question No: 9 Of 50 Time Left : 59:18
ОА
QUESTION
Which of the following two entities (reading from Left to right) can be connected by the dot operator?
A class member and a class object.
A class object and a class,
A constructor and a member of that class.
OB
Ос
OD
A class object and a member of that class.

Answers

Answer:b

Explanation:

to get points

WHAT IS ONE WAY A PIVOTTABLE COULD COMBINE THE FOLLOWING DATA

Answers

Answer: You sort table data with commands that are displayed when you click a header arrow button. Hope it help's :D

What can be used to store data, plant viruses, or steal data?

Answers

Answer:

ITS A SIMPLE ANSWER BUT THE PROBLEM IS TOO BIG!

Explanation:

The phishing email might contain a link which on clicking will take you to a fake web page. For example, the link might take you to a fake bank website which looks very legitimate but in reality is just a lookalike. If the victim falls for the scam and enters his/her account details on the website, the details will actually go to the hacker's server instead of going to the bank and the hacker will have all the information that the victim has provided on the website.

Code Example 9-1 struct Product { string name; double price; int quantity; }; (Refer to Code Example 9-1.) Given a Product object named product, which of the following statements would you use to display the value of the name data member on the console? a. cout << product::name; b. cout << product.name; c. cout << product("name"); d. cout << product[0];

Answers

Answer:

a. cout << Product ::name;

Explanation:

Computer software use different languages which helps user to initiate command. When a user initiates command the results are displayed according to input command. If product name is required as output then insert command should be product::name; this will display names of different products present in the system.

College
START: what new information, strategies, or techniques have you learned that will increase your technology skills? Explain why its important to START doing this right away

Answers

Answer:

Read Technical Books. To improve your technical skills and knowledge, it's best to read technical books and journals. ...

Browse Online Tutorials. ...

Build-up online profile. ...

Learn new Tools. ...

Implement what you learned. ...

Enrich your skillset. ...

Try-out and Apply.

discribe two ways you can zoom in and out from an image

Answers

How to zoom in: u get any two of ur fingers and instead of going inward like ur tryna pop a zit, you go out

How to zoom out: pretend like ur popping pimples on ur phone/device screen

Is IBM 1041, Minicomputer? Yes or no​

Answers

Answer:

No

Explanation:

PartnerServer is a Windows Server 2012 server that holds the primary copy of the PartnerNet.org domain. The server is in a demilitarized zone (DMZ) and provides name resolution for the domain for Internet hosts.
i. True
ii. False

Answers

Answer:

i. True

Explanation:

A Domain Name System (DNS) can be defined as a naming database in which internet domain names (website URLs) are stored and translated into their respective internet protocol (IP) address.

This ultimately implies that, a DNS is used to connect uniform resource locator (URL) or web address with their internet protocol (IP) address.

Windows Server 2012 is a Microsoft Windows Server operating system and it was released to the general public on the 4th of September, 2012, as the sixth version of the Windows Server operating system and the Windows NT family.

PartnerServer is a Windows Server 2012 server that was designed and developed to hold the primary copy of the PartnerNet dot org domain.

Typically, the server is configured to reside in a demilitarized zone (DMZ) while providing name resolution for the domain of various Internet hosts.

In order to prevent a cyber attack on a private network, end users make use of a demilitarized zone (DMZ).

A demilitarized zone (DMZ) is a cyber security technique that interacts directly with external networks, so as to enable it protect a private network.

Components of micro computer with diagram

Answers

Answer:

CPU, Program memory, Data memory, Output ports,  Input ports and Clock generator.

Explanation:

There are six basic components of a microcomputer which includes CPU, Program memory, Data memory, Output ports,  Input ports and Clock generator. CPU is the central processing unit which is considered as the brain of the computer. It is the part of a computer that executes instructions. Data memory is the place where data is stored that is present in the CPU.

(1)similarities between backspace key and delete key. (2) different between backspace key and delete key. (3) explain the term ergonomics. (4) explain the following. a click b right click double click d triple click e drag and drop.​

Answers

Answer:

ddhejaajegxhzi

Explanation:

jfrhsjadigugud

Peter is a new business owner. Because Peter is on a strict budget, he uses an older Novell NetWare server. The NetWare server still relies on the legacy IPX/SPX network protocol suite. Peter needs to connect his server to the Internet. He decides to use a gateway instead of a router. What is the likely motive behind Peter's decision

Answers

The most likely motive of Peter's decision to use a gateway for connecting his serve to the internet is to get a wireless connection for the internet.

A gateway server is used to communicate to the internet service provider. It is used to receives the data. It helps to sends the data to the router in order to translate as well as distribute the wireless devices.

In the context, Peter who is on a strict budget uses gateway system to connect to the internet and he uses the older version of Novell NetWare server.

Learn More :

https://brainly.in/question/35731153

Write a program get_price.py with a function get_price() that takes a dictionary of fruits as an argument and returns the name of the most expensive fruit. Each item of the dictionary includes: A key: the name of the fruit A value: the price of the fruit.

Answers

Answer:

The program is as follows:

def get_price(fruits):

   AllPrice = fruits.values()

   value_iterator = iter(AllPrice)

   mostExpensive = next(value_iterator)  

   for item in fruits:

       if fruits[item]>=mostExpensive:

           mostExpensive = fruits[item]

           fruitName = item

   print(fruitName)

fruits = {}

n = int(input("Number of Fruits: "))

for i in range(n):

   name = input("Fruit name: ")

   price = int(input("Fruit price: "))

   fruits[name] = price

get_price(fruits)

Explanation:

This defines the get_price function

def get_price(fruits):

This gets all price in the dictionary fruit

   AllPrice = fruits.values()

This passes the values to a value iterator

   value_iterator = iter(AllPrice)

This initializes mostExpensive to the first price in the dictionary

   mostExpensive = next(value_iterator)

This iterates through the elements of the dictionary  

   for item in fruits:

If current element is greater than or equals most expensive

       if fruits[item]>=mostExpensive:

Set most expensive to the current element

           mostExpensive = fruits[item]

Get the corresponding fruit name

           fruitName = item

Print fruit name

   print(fruitName)

The main begins here

This initializes the fruit dictionary

fruits = {}

This gets input for the number of fruits

n = int(input("Number of Fruits: "))

This is repeated for every inputs

for i in range(n):

Get fruit name

   name = input("Fruit name: ")

Get fruit price

   price = int(input("Fruit price: "))

Append name and price to dictionary

   fruits[name] = price

Call the get_price function

get_price(fruits)

Select the correct statement(s) regarding IP addressing.
a. IPv4 and IPv6 addressing is fully compatible with one another.
b. CIDR address format represents a Class C network only used within an intranet.
c. Subnet masks are used with both class and classless IP addresses.
d. all statements are correct.

Answers

Yeah the answer is b

Subnet masks are used with both class and classless IP addresses is the correct statement. Therefore, the correct option is C.

What is an IP address?

A device on the internet or a local network may be identified by its IP address, which is a special address. The rules defining the format of data delivered over the internet or a local network are known as “Internet Protocol,” or IP.

Only C is correct, rest other statements are incorrect because:

a. IPv4 and IPv6 addressing is fully compatible with one another is incorrect. While IPv4 and IPv6 can coexist on the same network, they are not fully compatible with one another.

b. CIDR address format represents a Class C network only used within an intranet is incorrect. Classless Inter-Domain Routing (CIDR) is a technique used to allocate IP addresses more efficiently.

Therefore, subnet masks are used with both class and classless IP addresses is the correct statement. Therefore, the correct option is C.

Learn more about,  here

https://brainly.com/question/3805118

#SPJ6

3. Write a program that prompts the user to input an integer that represents cents. The program will then calculate the smallest combination of coins that the user has. For example, 27 cents is 1 quarter, 0 nickle, and 2 pennies. That is 27=1*25+0*5+2*1.

Answers

Answer:

The program in Python is as follows:

cents = int(input("Cents: "))

qtr = int(cents/25)

cents = cents -qtr * 25

nkl = int(cents/5)

pny = cents -nkl * 5

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

Explanation:

This gets input for cents

cents = int(input("Cents: "))

This calculates the quarters in cents

qtr = int(cents/25)

This gets the remaining cents

cents = cents -qtr * 25

This calculates the nickel in remaining cents

nkl = int(cents/5)

This calculates the pennies in remaining cents

pny = cents -nkl * 5

This prints the required output

print(qtr,"quarters,",nkl,"nickels,",pny,"pennies")

g A catch block that expects an integer argument will catch Group of answer choices all exceptions all integer exceptions any exception value that can be coerced into an integer C

Answers

Answer:

Hence the correct option is 2nd option. all integer exceptions.

Explanation:

A catch block that expects an integer argument will catch all integer exceptions.

explain the working principle of computer? can anyone tell​

Answers

Answer:

input process and output hehe

5. A student wants to send a picture to the printer, how should they
send it?
a. 0,99,0
b. -65, 10, 5,0
c. 115, 118,0
d. #584504

Answers

Answer:

d

Explanation:

The SEI/CERT website is full of best-practices for developing secure code for various popular programming languages. Select a software threat/vulnerability of your choice and idenitfy two secure coding practices to mitigate that threat/vulnerability. You may choose any programming language you wish.

Answers

Answer:  

Input-Output rule:  

char *file_name:

FILE *f+ptr;  

f_ptr = fopen(file_name, "w");

if(f_ptr == NULL){

}  

if(fclose(f_ptr)!=0){

}  

if(remove(file_name) !=0){

}  

Expression:  

void set_fl(int num ,int *s_fl){

if(NULL == s_fl){

return;

}  

if(num>0){

*s_fl =1;

}

else if(num <0) {

*s_fl = -1;

}

}  

int is_negative(int num) {

int s;

set_fl(num , &s);

return s<0;

Explanation:  

Computer Emergency Response Team(CERT) has found most vulnerabilities discovered in applications stem from a comparatively small number of common programming errors that developers repeatedly make. The CERT secure coding initiative is functioning to determine secure coding standards for commonly used programming languages and to advance the practice of secure coding.

There are many security coding practices:  

SEI CERT C coding standard:  

The C rules and proposals are a piece ongoing and reflect the present thinking of the secure coding community. As rules and proposals mature, they're published in report or book form as official releases.

What values are in the vector named pressures after the following code is executed? vector pressures; pressures.push_back(32.4); pressures.push_back(33.5); pressures.insert(pressures.begin(), 34.2); int index = 2; pressures.insert(pressures.begin() + index, 31.8); pressures.push_back(33.3); index = 1; pressures.erase(pressures.begin() + index); a. 34.2, 31.8, 33.3 b. 34.2, 33.5, 31.8, 33.3 c. 34.2, 33.5, 33.3 d. 34.2, 31.8, 33.5, 33.3

Answers

Answer:

Hence the correct option is A that is "34.2 31.8 33.5 33.3".

Explanation:  

Program:-  

#include <iostream>

#include<vector>  

using namespace std;  

int main()

{

int count =0;

vector<double> pressures;

pressures.push_back(32.4);

pressures.push_back(33.5);

pressures.insert(pressures.begin(), 34.2);

int index = 2;

pressures.insert(pressures.begin() + index, 31.8);

pressures.push_back(33.3);

index = 1;

pressures.erase(pressures.begin() + index);

for (auto it = pressures.begin(); it != pressures.end(); ++it)

cout << ' ' << *it;

return 0;

}

Over-activity on LinkedIn?

Answers

Answer:

Being over-enthusiastic and crossing the line always get you in trouble even if you’re using the best LinkedIn automation tool in the world.  

When you try to hit the jackpot over the night and send thousands of connection requests in 24 hours, LinkedIn will know you’re using bots or tools and they will block you, temporarily or permanently.    

This is clearly against the rules of LinkedIn. It cracks down against all spammers because spamming is a big ‘NO’ on LinkedIn.    

What people do is that they send thousands of connection requests and that too with the same old spammy templates, “I see we have many common connections, I’d like to add you to my network.”    

It will only create spam.    

The LinkedIn algorithm is very advanced and it can easily detect that you’re using a bot or LinkedIn automation tool and you’ll be called out on it.

Give examples of applications that access files by each of the following methods:
+ Sequentially.
+ Random.

Answers

Answer:

Explanation:

Usually, applications would have the capability of using either one of these options. But for the sake of the question here are some that usually prefer one method over the other.

Any program that targets an API usually uses Sequential access. This is because API's contain all of the data as objects. Therefore, you need to access that object and sequentially navigate that object to the desired information in order to access the data required.

A music application would have access to an entire folder of music. If the user chooses to set the application to randomly play music from that folder, then the application will use a Random Access method to randomly choose the music file to load every time that a song finishes.

give one advantage of saving file in the same folder

Answers

Answer:

it's easier to find

Explanation:

things are much more organized

So you don’t have to go through many files

The internet's data pathways rely on what kind of hardware device to route data to its destination?
servers

routers

IP addresses

ISPs

Answers

Answer:

Routers

Explanation:

Essentially a router is a device used in networking that route packets of data from one computer network to another.

Answer:

routers

Explanation:

Routers are hardware devices that route the data from place to place. Data "hops" from one router to another until it reaches its destination. ISPs and IP addresses are not hardware devices. Servers are hardware devices but do not route data.

-Edge 2022

11111 Power 2 sovle ​

Answers

123,454,321. you just multiply 11111 by itself

Neymar machine that Run on electricity

Answers

"Neymar" = "name a"?

if so, well, there are many, like the little glowing box you use the type questions to the brainliest community, let it be a phone, a pc, or a molded Nintendo

if you meant Neymar indeed, I'm not sure if he runs on electricity, unless he is a soccer playing android somehow.

Other Questions
a new automobile cost 11300 which is 100 more than 25 times a certain number what is the number During its first year of operations, the McCormick Company incurred the following manufacturing costs: Direct materials, $6 per unit, Direct labor, $4 per unit, Variable overhead, $5 per unit, and Fixed overhead, $240,000. The company produced 30,000 units, and sold 20,000 units, leaving 10,000 units in inventory at year-end. Income calculated under variable costing is determined to be $370,000. How much income is reported under absorption costing? a. $370,000 b. $290,000 c. $610,000 d. $450,000 Mentally, sexual health includes all of the following EXCEPT:A. being able to experience sexual pleasure, satisfaction, and intimacy when desiredB. the choice to have pleasurable sexual experiences free of coercionC. understanding that sexuality is natural and involves more than sexual behaviorD. avoiding or preventing disease, infection, or unwanted pregnancies PLEAS HELP I WILL GIVE BRAINLIEST TO THE RIGHT ANSWERSThe Pollution by Problem Roberto Bererra Unfortunately, pollution is like air: its everywhere! Pollution is the introduction of harmful substances into the environment that can cause damage and harm to humans, animals, and the environment. It takes on a number of different forms, from chemicals and garbage to something as seemingly innocent as light or noise. Pollution comes from a variety of sources. In addition, it alters, changes, and even destroys a variety of places. For example, exhaust from cars pollutes the air. When it rains, runoff from fertilizers and pesticides, which farmers use to help crops grow, can pollute the water in oceans, rivers, lakes, and streams. Garbage dumped in landfills is not only an eyesore, but also a source of harmful gases that can damage the earths atmosphere. Light pollution, which comes in the form of bright streetlights or signs, disrupts the view of the night sky. Noise pollution caused by cars, trucks, and machines interrupts the natural sounds of the world around us, such as birds singing or leaves rustling. The types of pollution and their effects vary greatly. At the same time, however, they are related; each type of pollution affects the other types. An example of the connection between different types of pollution is acid rain. Acid rain is caused mostly by sulfur or nitrogen emissions given off by sources such as car exhaust and the burning of fossil fuels such as coal. These harmful chemicals rise into the atmosphere where they react with other compounds and then fall as an acidic form of rain, sleet, or snow. Acid rain damages plants and buildings, contaminates soil and water, and has a negative effect on animals, fish, and even humans. Pollution has other effects, too. Breathing toxic air or drinking polluted water can cause humans and animals to develop health problems that can be serious and sometimes deadly. The deaths of too many members of a certain species of animal can upset the local ecosystem, or the area in which they live. As a result, weather patterns and climates can also change. Though pollution is everywhere, there are ways to help prevent it. By walking or riding bikesinstead of driving carspeople can help decrease air pollution. People can also buy and eat organic foods to support farmers that do not use fertilizers on their crops. It is also a good idea to take old things that people intend to throw away and find new ways to use them. A great way to help the environment is to recycle. Save items like used paper, glass and plastic bottles, and metal cans. Then, take them to a recycling center where they can be turned into new products to be used again. Some cities and towns even have recycling programs in place so all you have to do is leave your recyclable items on the curb on a certain day each week. It doesnt get much easier to help the environment and reduce pollution than that! in what ways can the government combat child abuse. Police sometimes measure shoe prints at crime scenes so that they can learn something about criminals. Listed below are shoe print lengths, foot lengths, and heights of males. Construct a scatterplot, find the value of the linear correlation coefficient r, and find the P-value of r. Determine whether there is sufficient evidence to support a claim of linear correlation between the two variables. Based on these results, does it appear that police can use a shoe print length to estimate the height of a male? Use a significance level of =0.01 How do l write a program which countdown from 10 to 3 In a biconditional statement, the output is true if at least one input is true. -true -false ai l ngi i ph qun Thanh what is kohlberg's theory based on What pose a hazzard threat of severe dangers to construction workers health The ________ is composed of a series of true and false questions in order to establish an individuals clinical profile. Select one: a. Rorschach Inkblot Test b. TEMAS Multicultural Thematic Apperception Test c. Minnesota Multiphasic Personality Inventory (MMPI) d. Contemporized-Themes Concerning Blacks Test (C-TCB) find the length of AB A company sells a product which has a unit sales price of $5, unit variable cost of $3 and total fixed costs of $150,000. The number of units the company must sell to break even is:___________.A. 50,000 units.B. 300,000 units.C. 75,000 units.D. 30,000 units. Help is needed here On average, 240 customers arrive at a bank every morning (8AM - noon), but they do so randomly (i.e., not exactly every minute). There is a single line at the bank after which a customer goes to one of the five bank tellers. A bank teller takes on average 3 minutes to help a customer, with a standard deviation of 1.5 minutes. How long does a customer spend in this bank on average? Tm l hc hc v tm hiu v nhng g After several miles of running and sprinting in intervals, the runners muscles ache and feel fatigued. Which is the best explanation for what has occurred?a. The runner's muscles have accumulated lactic acid.b. The runners body has failed to perform cellular respiration.c. The runners cells are relying completely on aerobic respiration.d. The runners muscles have accumulated carbon dioxide. I Have A Comic Book That Has An Advertisement About Advanced Dungeons and Dragons, And I'm Considering Getting The Board Game And I Don't Know How To Play normal Mode And I Have No One To Show It To For Ideas On What To Do With Board Game?? solve for w: 7w < -56