Python Basics Assessment

Python Basics Assessment

12th Grade

15 Qs

quiz-placeholder

Similar activities

Python Programming Quiz

Python Programming Quiz

9th - 12th Grade

14 Qs

Subroutines - Procedures & Functions

Subroutines - Procedures & Functions

9th - 12th Grade

20 Qs

Intro to Python Programming - Year 8

Intro to Python Programming - Year 8

8th Grade - University

20 Qs

Quiz on Python Functions

Quiz on Python Functions

12th Grade

11 Qs

Data visualization

Data visualization

10th Grade - University

12 Qs

Python programming

Python programming

6th - 12th Grade

16 Qs

Python- Operators

Python- Operators

12th Grade

10 Qs

Python User Defined Functions

Python User Defined Functions

12th Grade

14 Qs

Python Basics Assessment

Python Basics Assessment

Assessment

Quiz

Computers

12th Grade

Medium

Created by

SUNITA YADAV

Used 1+ times

FREE Resource

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What are the basic data types in Python?

int, float, str, bool, list, tuple, set, dict

char, float, array, dict

int, float, str, bool, array, dict

int, float, str, boolean, list

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

declare variable_name as value

variable_name : value

You declare a variable in Python by using the syntax: variable_name = value.

value = variable_name

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

The main difference is that lists are mutable and tuples are immutable.

Tuples are created using square brackets, while lists use parentheses.

Lists can contain only numbers, while tuples can contain any data type.

Lists are faster than tuples in all operations.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

To define a function in Python.

To execute code conditionally based on a boolean expression.

To create a loop in Python.

To import modules in Python.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a loop that iterates over a list in Python?

for item in my_list: print(item)

for item in range(len(my_list))

while item in my_list:

foreach item in my_list:

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a function in Python and how is it defined?

A function in Python is defined using the 'def' keyword, followed by the function name and parentheses.

A function in Python is created with the 'create' keyword.

A function in Python is defined using the 'func' keyword.

A function in Python is defined by writing its name followed by a colon.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the purpose of the 'return' statement in a function?

To define the function's parameters.

To create a loop within the function.

The purpose of the 'return' statement is to provide a value from a function to its caller.

To end the function execution immediately.

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?