This set of MCQ is for the if conditionals in the Python content. Couldn't get the output to show up as multiple lines as it would print. As is I had to use both a bullet and a letter for the answers. Suggestions?
Given the following code, which output would be printed if num = 137?
if num > 100:
print 'greater'
if num % 2 == 0:
print 'even'
elif num % 2 == 1:
print 'odd'
else:
print 'not greater'
greater
even
greater
odd
odd
not greater
odd
not greater
Given the following code, which output would be printed?
for num in range(98,102):
if num > 100:
print num, 'greater'
else:
print num, 'not greater'
98 not greater
99 not greater
100 not greater
101 greater
102 greater
(testing understanding of range counting)98 not greater
99 not greater
100 greater
101 greater
(testing understanding of conditional statement)98 not greater
99 not greater
100 not greater
101 greater
(correct answer)98 not greater
99 not greater
101 greater
(testing understanding of conditional statement)Not sure if the 'none of the above' makes sense for the 2nd question but I wanted to include it since someone could have more than one misconception. Not sure if that is helpful or not. This was a bit more difficult than I expected it to be. Takes a lot of work to think of a question while considering if the answers will give information about a misconception.