Python Programming Quiz

Python Programming Quiz

1st Grade

20 Qs

quiz-placeholder

Similar activities

Computer parts

Computer parts

KG - 2nd Grade

15 Qs

Languages - Javascript and Node

Languages - Javascript and Node

1st - 12th Grade

21 Qs

Python

Python

1st Grade

22 Qs

python 3-4

python 3-4

1st Grade

20 Qs

Python Basics

Python Basics

KG - University

16 Qs

ASK T2 3.2 STRUKTUR KOD ARAHAN

ASK T2 3.2 STRUKTUR KOD ARAHAN

1st - 3rd Grade

20 Qs

PYTHON 2 REVIEW

PYTHON 2 REVIEW

KG - 1st Grade

15 Qs

Python Basics

Python Basics

KG - University

15 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

1st Grade

Hard

Created by

Adham Elmuntser

Used 1+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following will correctly prompt the user to enter a number and print it?

num = input("Enter a number: ") print(f"You entered: {num}")

num = input("Enter a number: ") print("You entered: " + num)

num = int(input("Enter a number: ")) print(f"You entered: {num}")

num = int(input("Enter a number: ")) print("You entered: " + num)

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly uses an if-elif-else statement?

if x > 10: print("x is greater than 10") elif x < 10: print("x is less than 10") else: print("x is equal to 10")

if x > 10: print("x is greater than 10") elif x < 10: print("x is less than 10") else: print("x is 10")

if x > 10: print("greater") elif x < 10: print("less") else: print("equal")

if x > 10 print("x is greater than 10") elif x < 10 print("x is less than 10") else print("x is equal to 10")

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following for loop? for i in range(5): print(i)

1 2 3 4 5

0 1 2 3 4

0 1 2 3 4 5

1 2 3 4

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which while loop will print the numbers 0 to 4?

count = 0 while count < 5: print(count) count += 1

count = 0 while count < 5: print(count) count = count + 1

count = 0 while count < 5: print(count); count += 1

count = 0 while count < 5: print(count); count = count + 1

5.

OPEN ENDED QUESTION

3 mins • 1 pt

How can you create a list and print its contents?

Evaluate responses using AI:

OFF

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following correctly creates and prints a set?

my_set = {1, 2, 3, 4, 5}; print(my_set)

my_set = set([1, 2, 3, 4, 5]); print(my_set)

my_set = {1, 2, 3, 4, 5}; print(set(my_set))

my_set = {1, 2, 3, 4, 5}; print(str(my_set))

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you create a tuple and print its elements?

my_tuple = (1, 2, 3); print(my_tuple)

my_tuple = tuple([1, 2, 3]); print(my_tuple)

my_tuple = (1, 2, 3) for item in my_tuple: print(item)

my_tuple = (1, 2, 3); print(list(my_tuple))

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?