subject
Computers and Technology, 05.05.2020 23:30 gloryxu

In this lab, you use what you have learned about searching a list to find an exact match to complete a partially prewritten Python program. The program uses a list that contains valid names for 10 cities in Michigan. You ask the user to enter a city name; your program then searches the list for that city name. If it is not found, the program should print a message that informs the user the city name is not found in the list of valid cities in Michigan. The starter file provided for this lab includes input statements. You need to write code to examine all the items in the list and test for a match. You also need to determine if you should print the "Not a city in Michigan." message. Comments in the code tell you where to write your statements.
Instructions:Study the prewritten code to make sure you understand it.
Write a loop statement that examines the names of cities stored in the list?
Write code that tests for a match?
Write code that, when appropriate, prints the message "Not a city in Michigan"?

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 11:00
Eva has many contacts on the professional networking site she uses which contacts are considered second degree
Answers: 3
question
Computers and Technology, 23.06.2019 14:30
Select the correct answer. sean is a computer programmer. he has programmed an application for toddlers that plays nursery rhymes. however, a logic error has occurred in the program. which problem is a likely consequence of the error? a. the program crashes every time the user wants to play the nursery rhymes. b. the program crosses its buffer boundaries and overwrites an adjacent program. c. the program plays a different nursery rhyme than the one the user intended to play. d. the program shows different structures in its programming language code. e. the program introduces new viruses every time the user plays a nursery rhyme.
Answers: 1
question
Computers and Technology, 24.06.2019 17:40
The value of sin(x) (in radians) can be approximated by the alternating infinite series create a function (prob3_2) that takes inputs of a scalar angle measure (in radians) and the number of approximation terms, n, and estimates sin(x). do not use the sin function in your solution. you may use the factorial function. though this can be done without a loop (more efficiently), your program must use (at least) one. you may find the mod() function useful in solving the problem.
Answers: 1
question
Computers and Technology, 24.06.2019 18:30
What are the benefits to using presentations to organize and deliver information in the workplace? they add visual appeal. they are easy to update. they ensure accuracy. they can be created quickly. the work can't be lost.
Answers: 1
You know the right answer?
In this lab, you use what you have learned about searching a list to find an exact match to complete...
Questions
question
Mathematics, 07.01.2020 21:31