PCEP Section 2a: Make decisions  with if instruction

PCEP Section 2a: Make decisions with if instruction

12th Grade

15 Qs

quiz-placeholder

Similar activities

Algorithms

Algorithms

12th Grade

15 Qs

Python

Python

1st - 12th Grade

10 Qs

CodeHS 5.1 Python

CodeHS 5.1 Python

9th Grade - Professional Development

15 Qs

CodeHS - Intro to Python - Conditionals Quiz

CodeHS - Intro to Python - Conditionals Quiz

9th Grade - Professional Development

15 Qs

Python elif and Nested if

Python elif and Nested if

12th Grade

15 Qs

การเขียนโปรแกรมไพทอน

การเขียนโปรแกรมไพทอน

12th Grade

20 Qs

DA METER REVIEW #5

DA METER REVIEW #5

12th Grade

18 Qs

TRẮC NGHIỆM PYTHON

TRẮC NGHIỆM PYTHON

9th - 12th Grade

10 Qs

PCEP Section 2a: Make decisions  with if instruction

PCEP Section 2a: Make decisions with if instruction

Assessment

Quiz

Computers

12th Grade

Medium

Created by

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

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?