Python Programming Quiz

Python Programming Quiz

University

18 Qs

quiz-placeholder

Similar activities

ITE 260 LEC

ITE 260 LEC

University

18 Qs

PSP Week 4

PSP Week 4

University

15 Qs

Code-101

Code-101

University

20 Qs

PYTHON REVISION

PYTHON REVISION

University

20 Qs

CSE 102 Exam 2 Practice

CSE 102 Exam 2 Practice

University

15 Qs

Python Quiz For Starters

Python Quiz For Starters

3rd Grade - Professional Development

17 Qs

Exceptions

Exceptions

University

20 Qs

Python_2R

Python_2R

KG - Professional Development

20 Qs

Python Programming Quiz

Python Programming Quiz

Assessment

Quiz

Computers

University

Easy

Created by

Janarthanan Sekar

Used 3+ times

FREE Resource

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'if-else' statement in Python?

To control the flow of execution

To create a loop

To handle exceptions

To define a function

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a mutable data type in Python?

List

Integer

Tuple

String

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What does the 'map' function do in Python?

Filters items from an iterable

Creates a new list from an iterable

Reduces an iterable to a single value

Applies a function to all items in an iterable

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a valid way to define a function in Python?

def my_function(param):

function my_function():

def my_function(param=default):

def my_function():

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the expression '5 // 2' in Python?

2.5

5

2

3

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which operator is used for membership testing in Python?

in

is

>

==

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'with' statement in Python?

To define a function

To handle exceptions

To manage resources

To create a loop

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?