102k views
0 votes
Num = int(input("Enter a number: "))

num = num % 4
if (num == 1):
print ("A")
elif (num == 2):
print ("B")
elif (num == 3):
print ("C")
elif (num == 4):
print ("D")
else:
print ("E")
If the user enters 5 what is output? _____________

User Bvanderw
by
4.3k points

1 Answer

6 votes

So, 5 is intered.

Line 1: num will recieve the integer 5

Line 2: Blank

Line 3: num will recieve 1, wich is the remainer of the division of 5 by 4.

Line 4: will return true, since num is indeed equal to 1.

Line 5: Will print "A"

Line 6: Will return false

Line 7: Gets jumped

Line 8: Will return false

Line 9: Gets jumped

Line 10: Will return false

Line 11: Gets jumped

Line 12: Will return false

Line 13: Gets jumped

The only OUTPUT is "A".

User Ankit Kumar
by
5.2k points