PP_Week7_Batch1

PP_Week7_Batch1

University

10 Qs

quiz-placeholder

Similar activities

Python: Chapter 7 - True or False (Lists and Tuples)

Python: Chapter 7 - True or False (Lists and Tuples)

9th Grade - University

8 Qs

TA MODUL 3 (VERSI 3)

TA MODUL 3 (VERSI 3)

University

10 Qs

Understanding Python Basics

Understanding Python Basics

University

15 Qs

Estructuras 1D

Estructuras 1D

University

12 Qs

Week 7 Quiz

Week 7 Quiz

University

15 Qs

Python Basics

Python Basics

KG - University

15 Qs

Python Training Day-1 Quiz-1

Python Training Day-1 Quiz-1

University

10 Qs

BOP-1

BOP-1

University - Professional Development

15 Qs

PP_Week7_Batch1

PP_Week7_Batch1

Assessment

Quiz

Computers

University

Hard

Created by

Narasimha Reddy Soora

Used 2+ times

FREE Resource

10 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct option with respect to Python.

Both tuples and lists are immutable.

Tuples are immutable while lists are mutable.

Both tuples and lists are mutable.

Tuples are mutable while lists are immutable.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

 

What will be the output of below Python code?

tuple1=(5,1,7,6,2)

tuple1.pop(2)

print(tuple1)

(5,1,6,2)

(5,1,7,6)

(5,1,7,6,2)

Error

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of below Python code?

tupl=("annie","hena","sid")

print(tupl[-3:0])

("annie")

()

None

Error as slicing is not possible in tuple.

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of below Python code?

tupl=([2,3],"abc",0,9)

tupl[0][1]=1

print(tupl)

([2,3],"abc",0,9)

([1,3],"abc",0,9)

([2,1],"abc",0,9)

Error

5.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which of the following are true of Python lists?

A list may contain any type of object except another list

A given object may appear in a list more than once

All elements in a list must be of the same type

These represent the same list:

['a', 'b', 'c']

['c', 'a', 'b']

There is no conceptual limit to the size of a list

6.

MULTIPLE SELECT QUESTION

20 sec • 1 pt

List a is defined as follows:


a = [1, 2, 3, 4, 5]


Select all of the following statements that remove the middle element 3 from a so that it equals [1, 2, 4, 5]:

a[2:3] = []

a[2] = []

a.remove(3)

a[2:2] = []

del a[2]

7.

MULTIPLE CHOICE QUESTION

20 sec • 1 pt

Consider this assignment statement:


a, b, c = (1, 2, 3, 4, 5, 6, 7, 8, 9)[1::3]


Following execution of this statement, what is the value of b:

5

4

3

6

7

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?