Search Header Logo

Mastering Python: Data Types & Functions

Authored by Kidi Tran

English

Professional Development

Mastering Python: Data Types & Functions
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the data type of the variable `x` in the following Python code snippet? ```python x = 3.14 ```

int

float

str

bool

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

`def my_function:`

`function my_function()`

`def my_function():`

`my_function() = function`

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python x = "Hello" y = "World" z = x + " " + y print(z) ```

`HelloWorld`

`Hello World`

`Hello, World`

`World Hello`

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is NOT a built-in data type in Python?

list

tuple

array

dict

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code? ```python def add(a, b): return a + b result = add(3, 4) print(result) ```

7

34

`add(3, 4)`

None

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following statements is used to import a module in Python?

`import module_name`

`include module_name`

`require module_name`

`using module_name`

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the result of the following expression in Python? ```python 5 // 2 ```

2.5

2

3

2.0

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?