Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

X=5,Y=7,Z=10 A. if(X<Y): print \"LESS\" else: print \"OTHER\" B. if (x == 1): pr

ID: 3795750 • Letter: X

Question

X=5,Y=7,Z=10

A. if(X<Y):

print "LESS"

else:

print "OTHER"

B.

if (x == 1): print "ONE"

elif (x == 2): print "TWO"

elif (x == 3): print "THREE"

elif (x == 4): print "FOUR"

elif (x == 5): print "FIVE"

elif (x == 6): print "SIX"

else: print "OTHER"

C.

if (X<Z):

print X

X = X + 1

D.

while (X<Z):

print X

X = X + 1

Q1. What is printed in A

Q2. What is printed in B

Q3. What is printed in C

Q4. How many lines are printed in C

Q5. How many lines are printed in D

Q6. What is the final value of X in A

Q7. What is the final value of X in B

Q8. What is the final value of X in C

Q9. What is the final value of X in D

Q10, What is the final value of Z in C

Q11. What is the final value of X in D

Q12. Is it legal to have an if with no else?

Q13. Is it legal to have an if with no elif?

Q14. Is the expression Y = X == 1 legal?

Q15. Is the expression IF (X<Z): legal?

Explanation / Answer

Q1 - LESS

Q2 - FIVE

Q3 - 5
6
7
8
9

Q4 - 5

Q5 - 5

Q6 - 5

Q7 - 5

Q8 - 9

Q9 - 9

Q10 - 10