PCEP Section 2a: Make decisions  with if instruction

PCEP Section 2a: Make decisions with if instruction

12th Grade

15 Qs

quiz-placeholder

Similar activities

PS Разминка перед циклами

PS Разминка перед циклами

9th - 12th Grade

13 Qs

CodeHS Python

CodeHS Python

9th Grade - Professional Development

15 Qs

Python Codehs

Python Codehs

9th Grade - Professional Development

15 Qs

Python Algorithm

Python Algorithm

4th Grade - University

15 Qs

Basic Python Coding

Basic Python Coding

11th - 12th Grade

15 Qs

Python programming

Python programming

6th - 12th Grade

16 Qs

Python Basics Quiz

Python Basics Quiz

11th - 12th Grade

12 Qs

Unit 4 Conditionals Assignment

Unit 4 Conditionals Assignment

11th - 12th Grade

15 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?