Question: What is the console output of the following Python script? Assume the user inputs the following string: 0 1 3 5 7 9 . user

What is the console output of the following Python script? Assume the user inputs the following string: 013579.
user_input = input('Enter numbers:')
tokens = user_input.split() # Split into separate strings
nums =[]
for token in tokens:
nums.append(int(token))
max_num = None
for num in nums:
if (max_num == None) and
(num %2==0):
max_num = num
elif (max_num != None) and
(num > max_num ) and (num %2==0):
max_num = num
print('Max #:', max_num)

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!