Python Programming Quiz

Python Programming Quiz

University

15 Qs

quiz-placeholder

Similar activities

PARC Linux Basic Part 2

PARC Linux Basic Part 2

University

20 Qs

CSS Pseudo dan CSS Grid System

CSS Pseudo dan CSS Grid System

University

20 Qs

SQL Quiz

SQL Quiz

University

18 Qs

Adobe Photoshop

Adobe Photoshop

University

10 Qs

After Effect Intoduction

After Effect Intoduction

10th Grade - University

15 Qs

Google Aptitude Test

Google Aptitude Test

KG - University

10 Qs

Memory-Mobo-Hard/Software

Memory-Mobo-Hard/Software

University

18 Qs

OOP 1 Undiksha

OOP 1 Undiksha

12th Grade - University

13 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

SUBBURAJ S

FREE Resource

AI

Enhance your content in a minute

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

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the purpose of variables in Python programming?

The purpose of variables in Python programming is to store and manipulate data.

The purpose of variables in Python programming is to handle exceptions.

The purpose of variables in Python programming is to display output.

The purpose of variables in Python programming is to create loops.

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is a valid data type in Python? a) Integer b) Float c) String d) All of the above

c) String

b) Float

a) Integer

d) All of the above.

3.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code snippet? x = 5 y = 2 print(x % y)

3

1

2

0

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

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

for

if

while

switch

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code snippet? numbers = [1, 2, 3, 4, 5] for num in numbers: print(num)

1 2 3 4

1 2 3 4 5

1 2 3 4 5 6

1 2 3 4 5

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which file mode is used to open a file for reading?

w

a

x

r

7.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code snippet? file = open('data.txt', 'r') print(file.read()) file.close()

The output of the code snippet will be the file object.

The output of the code snippet will be the contents of the 'data.txt' file.

The code will throw an error because the file 'data.txt' does not exist.

The output of the code snippet will be an empty string.

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?

Discover more resources for Computers