Python Programming Quiz

Python Programming Quiz

12th Grade

10 Qs

quiz-placeholder

Similar activities

Оформлення текстових документів

Оформлення текстових документів

12th Grade

14 Qs

Treasure Hunt

Treasure Hunt

12th Grade

10 Qs

tin 10 l11

tin 10 l11

12th Grade

10 Qs

Penilaian Harian-1, Pemrograman Berorientasi Objek (PBO)

Penilaian Harian-1, Pemrograman Berorientasi Objek (PBO)

12th Grade

10 Qs

Recap

Recap

12th Grade

10 Qs

ukuran data

ukuran data

1st - 12th Grade

10 Qs

TRẮC NGHIỆM TIN 12 KỲ II

TRẮC NGHIỆM TIN 12 KỲ II

10th - 12th Grade

10 Qs

UAS Desain Media Interaktif

UAS Desain Media Interaktif

12th Grade

15 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

12th Grade

Practice Problem

Hard

Created by

Janaki Sivakumar

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...

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct syntax to create a function in Python?

function myFunction():

def myFunction[]:

def myFunction():

create function myFunction():

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? x = [1, 2, 3] print(x * 2)

[1, 2, 3, 1, 2, 3]

[2, 4, 6]

[[1, 2, 3], [1, 2, 3]]

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is the correct way to read a file in Python?

file = open("filename.txt", "r")

file = open("filename.txt")

file = open("filename.txt", "read")

file = open("filename.txt", "w")

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? my_list = [2, 4, 6, 8] my_list.append(10) print(my_list)

[2, 4, 6, 8]

[2, 4, 6, 8, 10]

[10, 2, 4, 6, 8]

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following data structures does Python's set type represent?

Ordered collection of unique elements

Unordered collection of unique elements

Ordered collection with duplicate elements

Unordered collection with duplicate elements

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the difference between a list and a tuple in Python?

Lists are immutable, tuples are mutable

Tuples are immutable, lists are mutable

Lists are faster to iterate over

Tuples allow duplicate values while lists do not

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? x = 5 y = 10 x, y = y, x print(x, y)

5 10

10 5

None None

Error

Access all questions and much more by creating a free account

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?