Search Header Logo

ML 1 Python

Authored by Rajad Shakya

others

University

Used 11+ times

ML 1 Python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

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

tuple
string
list
frozenset

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python x = [1, 2, 3] print(x[1]) ```

IndexError
3
2
1

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following methods can be used to add an element to the end of a list?

insert()
extend()
pop()
append()

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following code? ```python x = (1, 2, 3) print(x[2]) ```

IndexError
2
1
3

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is an immutable data type in Python?

tuple
list
dictionary
set

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

How do you create a tuple in Python?

tuple = {}
tuple = ()
tuple = ()()
tuple = []

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the correct syntax to define a function in Python?

function_name():
create function_name():
def function_name():
function function_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

Microsoft

Continue with Microsoft

or continue with

Facebook

Facebook

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?