Answer:
Two Python codes are explained for the problem. Modify as appropriate
Explanation:
<u>CODE 1:</u>
def string_contains(input_string): # called function
if(input_string.__contains__('z')): # Check input_string contains 'z'
print('has the letter z.') # print input_string contains 'z'
else:
print('not worthwhile.') # print if input_string not contains 'z'
input_string = input('Please enter the string: ') # ACeept string from user
string_contains(input_string) # calling function where we pass input_string as actual parameter
<u>CODE 2:</u>
def string_contains(input_string):
for x in input_string:
if x=='z':
return 'has the letter z'
return 'not worthwhile'