Question: Please give the expected output from the given code samples. If the code will result in an error (which some may) please correct the error
Please give the expected output from the given code samples. If the code will result in an error (which some may) please correct the error so it will properly run and then give the output. NOTE: any errors in spacing or quotes are not intentional, Word will sometimes change spacing and symbols. Uses Python code
if (var == 9418):
print("Hmmm. That is a very specific number")
elif (var > 3):
print("I do not like your number")
if (var % 2 == 0):
print("At least your number is even")
else:
print("What an ODD choice")
else:
print("I like small numbers")
print("Thanks for playing")
For Questions 1-5 use the above code.
- var = 5
- var = 2
- var = 8
- var = 9418
- var = -3
For question 6, assume the user has input a 4 as the user input.
- Num = input("Enter an Integer")
if Num > 2:
print(num / 2)
else:
print(num + 3)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
