Search Header Logo

Exploring Python Basics

Authored by Aghata Dhiwi Ashita

Computers

12th Grade

Used 3+ times

Exploring Python Basics
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?

str, bool, complex, array

int, float, str, bool

char, list, tuple, dict

int, float, list, set

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you declare a variable in Python?

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

let variable_name = value

var variable_name = value

variable_name : value

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

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

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

Lists are faster than tuples in all operations.

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

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 import modules into a Python script.

To create a loop that iterates over a list.

To execute code conditionally based on a boolean expression.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a function in Python?

def function_name(parameters): # function body

function function_name(parameters) { // function body }

create function_name(parameters): # function body

function_name(parameters) -> void: # function body

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is a module in Python?

A module is a built-in function in Python.

A module in Python is a file containing Python code that can be imported and used in other Python programs.

A module is a graphical user interface in Python.

A module is a type of variable in Python.

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How can you import a module in Python?

Use the 'require' statement, e.g., 'require(module_name)'

Use the 'import' statement, e.g., 'import module_name'.

You can import a module by typing 'include module_name'

Import modules using 'load module_name'

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?