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/26
Score 0
What is the result of the following conditional statement in Python? x = 10 if x > 5: print('Greater than 5') else: print('Less than or equal to 5')
30
Less than or equal to 5
Greater than or equal to 5
Greater than 5
Equal to 5
Q 2/26
Score 0
What will be the output of the following Python code snippet? num = 15 if num % 2 == 0: print('Even') else: print('Odd')
30
Error
None
Odd
Even
26 questions
Q.
What is the result of the following conditional statement in Python? x = 10 if x > 5: print('Greater than 5') else: print('Less than or equal to 5')
1
30 sec
Q.
What will be the output of the following Python code snippet? num = 15 if num % 2 == 0: print('Even') else: print('Odd')
2
30 sec
Q.
What will be the output of the following code in Python? age = 16 if age >= 18: print('You are an adult') else: print('You are a minor')
3
30 sec
Q.
What will be the output of the following Python code snippet? grade = 85 if grade >= 90: print('A') elif grade >= 80: print('B') else: print('C')
4
30 sec
Q.
What will be the output of the following Python code snippet? x = 0 if x: print('True') else: print('False')
5
30 sec
Q.
What will be the output of the following Python code snippet? num1 = 10 num2 = 20 if num1 < num2: print('num1 is less than num2')
6
30 sec
Q.
What will be the output of the following Python code snippet? num = -5 if num > 0: print('Positive') elif num < 0: print('Negative') else: print('Zero')
7
30 sec
Q.
What will be the output of the following Python code snippet? x = 5 if x == 5: print('x is equal to 5')
8
30 sec
Q.
What will be the output of the following Python code snippet? weather = 'rainy' if weather == 'sunny': print('Enjoy the sunshine!') else: print('Remember to bring an umbrella!')
9
30 sec
Q.
What will be the output of the following code in Python? num = 0 if num: print('Non-zero') else: print('Zero')
10
30 sec
Q.
What is the correct way to write an if statement in Python?
11
30 sec
Q.
How can you check if two variables are equal in Python?
12
30 sec
Q.
What is the purpose of the 'else' statement in Python?
13
30 sec
Q.
What is the output of the following code snippet?x = 10y = 5if x > y: print('x is greater than y')
14
30 sec
Q.
What is the purpose of the 'elif' statement in Python?
15
30 sec
Q.
What is the output of the following code snippet?num = 7if num % 2 == 0: print('Even number')else: print('Odd number')
16
30 sec
Q.
What is the correct way to check if a variable is not equal to a certain value in Python?
17
30 sec
Q.
What does the 'and' operator do in Python?
18
30 sec
Q.
What is the purpose of the 'or' operator in Python?
19
30 sec
Q.
What is the correct way to check if a number is within a specific range in Python?
20
30 sec
Q.
When using conditionals in Python, what does the 'elif' statement stand for?
21
30 sec
Q.
What is the correct way to check if a string 'word' is equal to 'hello' in Python?
22
30 sec
Q.
How can you check if a number is positive in Python?
23
30 sec
Q.
Which of the following is the correct syntax for an if statement in Python?
24
30 sec
Q.
What is the correct way to check if a number 'num' is less than or equal to 10 in Python?
25
30 sec
Q.
What is the correct way to check if a variable 'x' is not equal to 5 in Python?