Tag the questions with any skills you have. Your dashboard will track each student's mastery of each skill.
Give this quiz to my class
Q 1/10
Score 0
In Python, which of the following if-else conditional structures would correctly print 'Number is positive' if the variable 'num' is greater than 0?
30
if num < 0: print('Number is positive')
if num == 0: print('Number is positive')
if num > 0: print('Number is positive')
if num > 0: print('Number is negative')
Q 2/10
Score 0
What will the following Python code print if 'score' is 85? 'if score >= 90: print("Grade A") else: print("Grade B")'
30
Grade B
Grade C
Grade A
Grade D
10 questions
Q.
In Python, which of the following if-else conditional structures would correctly print 'Number is positive' if the variable 'num' is greater than 0?
1
30 sec
Q.
What will the following Python code print if 'score' is 85? 'if score >= 90: print("Grade A") else: print("Grade B")'
2
30 sec
Q.
What will the following code output if 'temperature' is 30? 'if temperature < 20: print("Cold") else: print("Warm")'
3
30 sec
Q.
What will the following Python code print if 'age' is 15? 'if age >= 18: print("Adult") else: print("Teenager")'
4
30 sec
Q.
What will the following code print if 'num' is 0? 'if num > 0: print("Positive") elif num == 0: print("Zero") else: print("Negative")'
5
30 sec
Q.
What will the following code output if 'value' is 50? 'if value < 20: print("Low") elif value < 60: print("Medium") else: print("High")'
6
30 sec
Q.
What will the following code print if 'time' is 21? 'if time < 12: print("Good morning") elif time < 18: print("Good afternoon") else: print("Good evening")'
7
30 sec
Q.
What will the following code output if 'number' is -5? 'if number >= 0: print("Positive") else: print("Negative")'
8
30 sec
Q.
In Python, what will the code 'if x < 10: print("Less than 10") else: print("10 or more")' output if 'x' is 10?
9
30 sec
Q.
Which statement correctly assigns a value based on the condition if 'light_on' is True? 'if light_on: print("The room is bright") else: print("The room is dark")'