Search Header Logo

Python Basics Assessment

Authored by SUNITA YADAV

Computers

12th Grade

Used 1+ times

Python Basics Assessment
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

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.

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?