You must create a function that takes a string as its sole input parameter. A string is the only return from the function. Using the input string as a basis, the function should generate a filename. This will be accomplished by capitalizing the initial letter and replacing each space in the string with an underscore, i.e. (" _ "). The function should return the newly formed filename. this code below generates filename elif command == "5": # filename = make_filename5(place) print(filename) an example would be: 'Dubai, Iraq, 2021' -------> make_filename5 ------->'Dubai,_iraq,_2021' 'spain is beautiful' ------> make_filename5 ------->'Spain_is_beautiful' 'America' ------> make_filename5 -------> 'America'
You must create a function that takes a string as its sole input parameter. A string is the only return from the function. Using the input string as a basis, the function should generate a filename. This will be accomplished by capitalizing the initial letter and replacing each space in the string with an underscore, i.e. (" _ "). The function should return the newly formed filename.
this code below generates filename
elif command == "5":
#<you will write this function here>
an example would be:
'Dubai, Iraq, 2021' -------> make_filename5 ------->'Dubai,_iraq,_2021'
'spain is beautiful' ------> make_filename5 ------->'Spain_is_beautiful'
'America' ------> make_filename5 -------> 'America'
elif command == "5":
<you will write this function here >
filename = make_filename1(place)
print(filename)
Step by step
Solved in 4 steps with 2 images