
Python If Statements
Authored by Ruth Lock
Computers
University
18 Questions
Used 36+ times

AI Actions
Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...
Content View
Student View
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct syntax for an if statement in Python?
if (condition) {code block}
if condition: code block
if condition then code block
if [condition] {code block}
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following operators is used to check if two values are not equal in Python?
!=
==
<=
>
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
How do you write an if statement to check if `x` is greater than 10?
if x > 10:
if x is > 10:
if x >> 10:
if x gt 10:
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the correct way to write a nested if statement in Python?
if condition1: if condition2: code block
if condition1: then if condition2: code block
if condition1 & if condition2: code block
if condition1 > if condition2: code block
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which logical operator is used in Python to combine two boolean conditions and returns True if both conditions are true?
OR
AND
NOT
XOR
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What is the output of the following code if `x = 5`? ```python if x > 2: print("Hello") elif x > 4: print("World") else: print("!") ```
Hello
World
!
Hello World
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which comparison operator is used to check if a value is less than or equal to another value in Python?
<
<=
==
!=
Access all questions and much more by creating a free account
Create resources
Host any resource
Get auto-graded reports

Continue with Google

Continue with Email

Continue with Classlink

Continue with Clever
or continue with

Microsoft
%20(1).png)
Apple
Others
Already have an account?
Similar Resources on Wayground
13 questions
Processing Quiz
Quiz
•
University
20 questions
HCI - UCD
Quiz
•
University
20 questions
Artificial Intelligence CT-1
Quiz
•
University
13 questions
BACS3323 Chapter 4 -Flocking Algorithm
Quiz
•
University
16 questions
Python Basics
Quiz
•
KG - University
20 questions
Python Recap
Quiz
•
7th Grade - University
18 questions
Programming in C language
Quiz
•
12th Grade - University
14 questions
Sorting Algorithms
Quiz
•
University
Popular Resources on Wayground
5 questions
This is not a...winter edition (Drawing game)
Quiz
•
1st - 5th Grade
25 questions
Multiplication Facts
Quiz
•
5th Grade
10 questions
Identify Iconic Christmas Movie Scenes
Interactive video
•
6th - 10th Grade
20 questions
Christmas Trivia
Quiz
•
6th - 8th Grade
18 questions
Kids Christmas Trivia
Quiz
•
KG - 5th Grade
11 questions
How well do you know your Christmas Characters?
Lesson
•
3rd Grade
14 questions
Christmas Trivia
Quiz
•
5th Grade
20 questions
How the Grinch Stole Christmas
Quiz
•
5th Grade
Discover more resources for Computers
26 questions
Christmas Movie Trivia
Lesson
•
8th Grade - Professio...
20 questions
christmas songs
Quiz
•
KG - University
20 questions
Holiday Trivia
Quiz
•
9th Grade - University
15 questions
Holiday Movies
Quiz
•
University
14 questions
Christmas Trivia
Quiz
•
3rd Grade - University
20 questions
Christmas Trivia
Quiz
•
University
8 questions
5th, Unit 4, Lesson 8
Lesson
•
KG - Professional Dev...
20 questions
Disney Trivia
Quiz
•
University