Question: Phython quiz, Execution Control (if, elif, else) Question 1 1 pts Consider the following program: userinput = eval(input(Enter a number: )) if userinput // 4
Phython quiz, Execution Control (if, elif, else)





Question 1 1 pts Consider the following program: userinput = eval(input("Enter a number: ")) if userinput // 4 'spinach': print('printout1') elif veggie > 'carrot': print('printout2') elif veggie > 'broccoli': print('printout3') else: print('printout4') Which of the following user inputs will give us 'printout4' Squash beets O asparagus cabbage string beans O peas zucchinis Lettuce Question 5 1 pts Consider the following program: userinput = eval(input("Enter a number: ")) if userinput % 2 == 0: print('line 1') print('line 2') else: print('line 3') The programmer who originally wrote this problem wanted 'line 1' and 'line 2' to print only if the user inputs an even number. Otherwise, 'line 3' should print. The programmer's code currently generates an error. How would you fix this? O indent else: O change "else" to "elif O delete else: and outdent print('line 3') o change "else" to "if" O indent print('line 2')
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
