Search Header Logo

Day 3 Python Quiz List and dictionaries

Authored by Oshi Maga

Education

University

Used 2+ times

Day 3 Python Quiz List and dictionaries
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

1. Which of the following would give an error?

A. list1=[]
B. list1=[]*3
C. list1=[2,8,7]
D. None of the above

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

2. Which of the following commands will create a list?

A. list1 = []
B. list1 = list()
C. list1 = list([1, 2, 3])
D. All of the mentioned

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

3. What is the output of the following code

A. PYnative
B. zara

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4. Which of the following is True regarding lists in Python?

A. Lists are immutable.
B. size(list1) command is used to find the size of lists.
C. Size of the lists must be specified before its initialization
D. Elements of lists are stored in contagious memory location.

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

5. What is the output when we execute list(“hello”)?

A. [‘llo’]
B. [‘hello’]
C. [‘olleh’]
D. [‘h’, ‘e’, ‘l’, ‘l’, ‘o’]

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

6. Which of the following creates a tuple?

A. tuple1=(5)*2
B. tuple1=("a","b")
C. tuple1[2]=("a","b")
D. None of the above

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

7. Which of the following is a Python tuple?

A. {}
B. {1, 2, 3}
C. [1, 2, 3]
D. (1, 2, 3)

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?