Python Programming Quiz

Python Programming Quiz

1st Grade

20 Qs

quiz-placeholder

Similar activities

Quiz 4

Quiz 4

1st - 10th Grade

20 Qs

Grade1-Revision Quiz

Grade1-Revision Quiz

KG - 2nd Grade

15 Qs

Ôn tập học kỳ 1 - Tin học 5 - 22&23

Ôn tập học kỳ 1 - Tin học 5 - 22&23

1st Grade

22 Qs

Ms Word

Ms Word

1st - 3rd Grade

15 Qs

Ulangan Harian X DKV

Ulangan Harian X DKV

1st Grade

20 Qs

Quiz 1

Quiz 1

1st - 12th Grade

15 Qs

class 1 - Full Revision1

class 1 - Full Revision1

1st Grade

15 Qs

Lección1 - JavaScript

Lección1 - JavaScript

1st Grade - Professional Development

17 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

1st Grade

Practice Problem

Hard

Created by

Adham Elmuntser

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?