Understanding Python Selection Basics

Understanding Python Selection Basics

8th Grade

20 Qs

quiz-placeholder

Similar activities

Quick Lookup - Printing Variables

Quick Lookup - Printing Variables

8th Grade

19 Qs

Ch. 10 Exam Review

Ch. 10 Exam Review

8th Grade

20 Qs

5-sinf. Kompyuter va Internet Asoslari

5-sinf. Kompyuter va Internet Asoslari

5th Grade - University

15 Qs

Quiz Informatika Genap KLs 7

Quiz Informatika Genap KLs 7

7th Grade - University

15 Qs

TOOLS AND EQUIPMENT IN COMPUTER PROGRAMMING

TOOLS AND EQUIPMENT IN COMPUTER PROGRAMMING

8th Grade

15 Qs

quiz1B1

quiz1B1

7th Grade - University

20 Qs

Programski jezik Python

Programski jezik Python

8th Grade

17 Qs

4.1 Kod Arahan

4.1 Kod Arahan

1st Grade - University

16 Qs

Understanding Python Selection Basics

Understanding Python Selection Basics

Assessment

Quiz

Information Technology (IT)

8th Grade

Hard

Created by

J Blakley

Used 2+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? ```python temperature = 18 if temperature < 20: print("It's a bit chilly today.") else: print("It's warm today.") ```

It's warm today.

It's a bit chilly today.

18

Nothing will be printed.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a comparison operator in Python?

and

or

==

not

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following expression? ```python 5 > 3 and 2 < 1 ```

True

False

5

2

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which statement will check if a variable `age` is at least 16?

if age > 16:

if age <= 16:

if age >= 16:

if age == 16:

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will the following code print? ```python colour = "blue" if colour == "red": print("Stop") else: print("Go") ```

Stop

Go

blue

Nothing

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a logical operator in Python?

>

and

=

!=

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python x = 10 if x != 5: print("x is not 5") else: print("x is 5") ```

x is 5

x is not 5

10

Nothing

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?