Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Need help with coding. Make a List ( 25 points) Write a program called citylist.py, in which the user inputs the names of cities, which

Need help with coding.
image text in transcribed
Make a List ( 25 points) Write a program called citylist.py, in which the user inputs the names of cities, which get added to a list. Your program should: - Include a comment in the first line with your name. - Include comments describing each major section of code. - Create a list - it should initially be empty. - Ask the user to input the name of a city or hit enter to end the list. - If the user adds the name of a city (i.e., anything other than a blank value): - Add the name to the list. - Tell the user that they've added [city] to the list (where [city] is the name that just got added). - Ask the user (again) to input a city name - and keep asking until the user hits enter without adding another name (i.e., enters a blank value). - Once the user enters a blank value: - Tell the user how many names they added to the list. - Using a for-loop, output all the names that are in the list, using a separate line for each name. - Do not include the blank value in the list

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Montgomerys Auditing Classic Reprint Series

Authors: Robert Hiester Montgomery

1st Edition

1390439356, 978-1390439359

More Books

Students also viewed these Accounting questions

Question

Observe the end of the glass tube and note what happens.

Answered: 1 week ago

Question

Identify the types of informal reports.

Answered: 1 week ago

Question

Write messages that are used for the various stages of collection.

Answered: 1 week ago