crash course on python week 2 quiz answers: Shuffle Q/A 2

40. What's the value of this Python expression: "big" > "small"?

  • True
  • False
  • big
  • small

41. What is the elif keyword used for?

  • To mark the end of the if statement
  • To handle more than two comparison cases
  • To replace the “or” clause in the if statement
  • Nothing – it’s a misspelling of the else-if keyword

42. When using an if statement, the code inside the if block will only execute if the conditional statement returns what?

  • False
  • A string
  • 0
  • True

43. What's the value of this Python expression?

((10 >= 5*2) and (10 <= 5*2))

  • True
  • False
  • 10
  • 5*2

44. Can you calculate the output of this code?

def greater_value(x, y):
if x > y:
return x
else:
return y

print(greater_value(10,3*5))

15

Devendra Kumar

Project Management Apprentice at Google

Leave a Reply