PCEP Section 2a: Make decisions with if instruction

Quiz
•
Computers
•
12th Grade
•
Medium
Misti McDaniel
Used 1+ times
FREE Resource
15 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct syntax for a simple `if` statement in Python?
if x > 10 then print("x is greater than 10")
if x > 10: print("x is greater than 10")
if (x > 10) { print("x is greater than 10") }
if x > 10 print("x is greater than 10")
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Small
Large
Error
5
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which keyword is used to check multiple conditions in sequence after an initial `if` statement in Python?
elseif
elif
else if
when
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Positive
Negative
Zero
Nothing
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the following is the correct way to nest an `if` statement inside another `if` statement in Python?
if x > 0: if y > 0: print("Both positive")
if x > 0 then if y > 0 then print("Both positive")
if x > 0: { if y > 0: print("Both positive") }
if x > 0: if y > 0 print("Both positive")
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
You want to print "Teenager" if the variable `age` is between 13 and 19 (inclusive). Which of the following code snippets will achieve this?
if age >= 13 and age <= 19: print("Teenager")
if age > 13 and age < 19: print("Teenager")
if 13 < age < 19: print("Teenager")
if age == 13 or age == 19: print("Teenager")
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
A
B
C
F
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Python Boolean and If

Quiz
•
9th - 12th Grade
15 questions
Y7 Python Mid Point

Quiz
•
7th - 12th Grade
10 questions
TRẮC NGHIỆM PYTHON

Quiz
•
9th - 12th Grade
20 questions
Python Basics 2

Quiz
•
9th - 12th Grade
10 questions
GDScript Quiz - Lesson 3 - Conditional statements & Iteration

Quiz
•
12th Grade
18 questions
Final Test Python Code

Quiz
•
9th - 12th Grade
15 questions
CodeHS - Intro to Python - Conditionals Quiz

Quiz
•
9th Grade - Professio...
15 questions
Python elif and Nested if

Quiz
•
12th Grade
Popular Resources on Wayground
18 questions
Writing Launch Day 1

Lesson
•
3rd Grade
11 questions
Hallway & Bathroom Expectations

Quiz
•
6th - 8th Grade
11 questions
Standard Response Protocol

Quiz
•
6th - 8th Grade
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
4 questions
Exit Ticket 7/29

Quiz
•
8th Grade
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
20 questions
Subject-Verb Agreement

Quiz
•
9th Grade
Discover more resources for Computers
40 questions
Algebra Review Topics

Quiz
•
9th - 12th Grade
19 questions
Handbook Overview

Lesson
•
9th - 12th Grade
62 questions
Spanish Speaking Countries, Capitals, and Locations

Quiz
•
9th - 12th Grade
20 questions
First Day of School

Quiz
•
6th - 12th Grade
6 questions
Maier - AMDM - Unit 1 - Quiz 1 - Estimation

Quiz
•
12th Grade
21 questions
Arithmetic Sequences

Quiz
•
9th - 12th Grade
21 questions
9th Grade English Diagnostic Quiz

Quiz
•
9th - 12th Grade
7 questions
Characteristics of Life

Interactive video
•
11th Grade - University