Write a program that will ask the user to input the names


Please do the coding in Python!

Write a program that will ask the user to input the names of cities they would like to visit.

This means that the program should ask the user first how many cites they want to input (function - AskForNumberCities).

Then the program should allow the user to input this and only this number of cities (function - AskForCityName).

If they input the same city name you should not count that as one of the cities. You only need to consider cities spelled EXACTLY the same way (e.g. Haifa and Haifa). Do not worry about upper and lowercase characters in city names.

After all the cities have been collected the program should then print a sentence that looks exactly like the following (function - PrintFirstCitySentence):

"You would like to visit Tel Aviv as city 1 and Haifa as city 2 and Negev as city 3 on your trip."

Next the program will take this sentence string and add 1 to each city number and then output the string with the changes (function - PrintAddOneCityNumSentence). For example,

"You would like to visit Tel Aviv as city 2 and Haifa as city 3 and Negev as city 4 on your trip."

NOTE: To do this I am requiring that you take the first sentence, split this sentence into a list, use isdigit() to determine if element of list is digit, add one to these elements, and join the new list elements together using join().

Since we just learned how to use the for loop and for loop with enumerate I am also requiring that you loop using for loops to show that you know how to use them. You may also use while loops where needed.

Remember, to find these built-in methods for a string type do the following:

>>> string_1 = 'hello'

>>> dir(string_1)

['__add__', '__class__', '__contains__', '__delattr__', '__doc__', '__eq__', '__format__', '__ge__', '__getattribute__', '__getitem__', '__getnewargs__', '__getslice__', '__gt__', '__hash__', '__init__', '__le__', '__len__', '__lt__', '__mod__', '__mul__', '__ne__', '__new__', '__reduce__', '__reduce_ex__', '__repr__', '__rmod__', '__rmul__', '__setattr__', '__sizeof__', '__str__', '__subclasshook__', '_formatter_field_name_split', '_formatter_parser', 'capitalize', 'center', 'count', 'decode', 'encode', 'endswith', 'expandtabs', 'find', 'format', 'index', 'isalnum', 'isalpha', 'isdigit', 'islower', 'isspace', 'istitle', 'isupper', 'join', 'ljust', 'lower', 'lstrip', 'partition', 'replace', 'rfind', 'rindex', 'rjust', 'rpartition', 'rsplit', 'rstrip', 'split', 'splitlines', 'startswith', 'strip', 'swapcase', 'title', 'translate', 'upper', 'zfill']

Request for Solution File

Ask an Expert for Answer!!
Python Programming: Write a program that will ask the user to input the names
Reference No:- TGS02888590

Expected delivery within 24 Hours