Y8 If, elif, else

Y8 If, elif, else

8th - 9th Grade

11 Qs

quiz-placeholder

Similar activities

Control Structure

Control Structure

9th Grade - University

12 Qs

Python - Conditional Programming

Python - Conditional Programming

8th Grade

10 Qs

Python Programming Basics

Python Programming Basics

7th - 11th Grade

12 Qs

Python - Loops & Lists

Python - Loops & Lists

7th - 11th Grade

15 Qs

Python Beginners Week 6

Python Beginners Week 6

3rd - 12th Grade

13 Qs

KS4 Programming Techniques (1)

KS4 Programming Techniques (1)

8th - 10th Grade

10 Qs

Python Boolean and If

Python Boolean and If

9th - 12th Grade

10 Qs

Python

Python

8th Grade

12 Qs

Y8 If, elif, else

Y8 If, elif, else

Assessment

Quiz

Computers

8th - 9th Grade

Hard

Used 86+ times

FREE Resource

11 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

The if, elif, else statement is used for...

selection

iteration

indentation

printing

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which symbol should go at the end of an if statement?

"

)

:

;

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

what does the == sign do in this code?

compares the value stored in the password variable with the string "secret"

assigns the string value "secret" to the password variable

prints the password

asks the user to input their password

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

what is the variable name in this code?

print

if

secret

password

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What will be the output when this code is run?

65

42

output A

output B

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

else: is used

to give an extra condition

to provide an output when the other conditions are false

because it is required

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

What is wrong with this code?

the if and else keywords need to switch

the if and elif keywords need to switch

the elif and else keywords need to switch

there needs to be an extra else statement

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?