PYTHON-04

PYTHON-04

9th - 12th Grade

25 Qs

quiz-placeholder

Similar activities

CodeHS Python Unit 3 Quiz Review

CodeHS Python Unit 3 Quiz Review

9th - 12th Grade

20 Qs

Python Strings Splicing

Python Strings Splicing

12th Grade

20 Qs

Python String

Python String

12th Grade

20 Qs

Python - List and Tuples

Python - List and Tuples

11th - 12th Grade

20 Qs

Data handling using pandas and Data visualization

Data handling using pandas and Data visualization

12th Grade

20 Qs

Python - Quiz 2

Python - Quiz 2

10th - 11th Grade

20 Qs

Python Class 9

Python Class 9

9th - 10th Grade

25 Qs

XII - CS - Lesson 9 - List and Tuple - Quiz 1

XII - CS - Lesson 9 - List and Tuple - Quiz 1

12th Grade

25 Qs

PYTHON-04

PYTHON-04

Assessment

Quiz

Computers

9th - 12th Grade

Hard

Created by

Riya Shakya

Used 7+ times

FREE Resource

25 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which keyword is used to check if a condition is true or false in Python?

a) if

b) else

c) elif

d) while

2.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What symbol is used to represent equality in a condition statement?

=

==

>

<

3.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

Which statement is used to execute a block of code repeatedly as long as a condition is true?

if

for

else

while

4.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

How do you combine multiple conditions in an if statement?

Using the or operator (|)

Using the and operator (&)

Using the not operator (~)

Using the in operator

5.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What is the output of the following code snippet?

x = 10

if x > 5:

print("Greater than 5")

else:

print("Less than or equal to 5")

Greater than 5

Less than or equal to 5

Greater than or equal to 5

Less than 5

6.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

How many times will the following loop execute?

count = 0

while count < 5:

count += 1

0

4

5

ERROR

7.

MULTIPLE CHOICE QUESTION

30 sec • 5 pts

What will be the output of the following code snippet?

x = 5

if x < 10:

print("Less than 10")

elif x < 7:

print("Less than 7")

else:

print("Greater than or equal to 7")

Less than 10

Less than 7

Greater than or equal to 7

No output

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?