2. If Elif and Else

2. If Elif and Else

10 Qs

quiz-placeholder

Similar activities

Unit 6  Energy and Heat vocabulary

Unit 6 Energy and Heat vocabulary

KG - University

15 Qs

GD: Unit 4

GD: Unit 4

9th - 12th Grade

8 Qs

Java Refresher

Java Refresher

KG - University

11 Qs

Role of programming language

Role of programming language

KG - University

12 Qs

c2 2-3 Variables Constants and Input - GCSE QUIZ

c2 2-3 Variables Constants and Input - GCSE QUIZ

KG - University

10 Qs

New Zealand Cadet Forces Code of Conduct Quiz

New Zealand Cadet Forces Code of Conduct Quiz

KG - University

10 Qs

"Mastering Python Basics"

"Mastering Python Basics"

KG - University

10 Qs

L1 Python Recall - Do Now

L1 Python Recall - Do Now

KG - University

8 Qs

2. If Elif and Else

2. If Elif and Else

Assessment

Quiz

others

Easy

Created by

Jeremy Talbot

Used 3+ times

FREE Resource

10 questions

Show all answers

1.

OPEN ENDED QUESTION

1 min • 1 pt

Media Image

Can you identify the issue present in this snippet of code?

Evaluate responses using AI:

OFF

Answer explanation

Because there is only 1 equals sign for the if statement.

2.

OPEN ENDED QUESTION

1 min • Ungraded

Media Image
What would be the output of the code above?

Evaluate responses using AI:

OFF

Answer explanation

Sorry you cannot afford to buy apples

3.

OPEN ENDED QUESTION

1 min • Ungraded

Media Image
What is the problem with this code?

Evaluate responses using AI:

OFF

Answer explanation

You’re checking to see if a variable called capital (which doesn’t exist) is equal to the word “Tokyo”, when it needs to be comparing it to the variable answer (which exists)

4.

OPEN ENDED QUESTION

1 min • Ungraded

Media Image
What will the output be when you have less then $5?

Evaluate responses using AI:

OFF

Answer explanation

Sorry you do not have enough money to make a purchase


5.

OPEN ENDED QUESTION

1 min • Ungraded

Media Image
Fill in the blank line

Evaluate responses using AI:

OFF

Answer explanation

elif arrive == “yes”:


6.

OPEN ENDED QUESTION

1 min • Ungraded

Media Image
Referencing the code, which print function will execute?

Evaluate responses using AI:

OFF

Answer explanation

Great Work


7.

OPEN ENDED QUESTION

1 min • Ungraded

Media Image
A female soccer team is looking for female players older than 12 years of age. Fill in the blank to abide by these 2 conditions.

Evaluate responses using AI:

OFF

Answer explanation

age = int(input(“How old are you”))

sex = input(“Are you female or male? Type ‘m’ for female or ‘f’ for female: “)

if age > 12 and sex == “f”:

print(“You are eligible for the team”)

else:

print(“Sorry you are not eligible for the team”)


OR

age = int(input(“How old are you”))

sex = input(“Are you female or male? Type ‘m’ for female or ‘f’ for female: “)

if sex == “f” and age > 12:

print(“You are eligible for the team”)

else:

print(“Sorry you are not eligible for the team”)


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?