PP_Week7_Batch1

PP_Week7_Batch1

University

10 Qs

quiz-placeholder

Similar activities

DBMS Module 3 - Relational Model

DBMS Module 3 - Relational Model

University

12 Qs

Basic python

Basic python

University

10 Qs

Python Basics

Python Basics

University

15 Qs

Python Workshop Day - 2

Python Workshop Day - 2

University

15 Qs

 Variables en Python

Variables en Python

University

10 Qs

Python Day 9

Python Day 9

University

6 Qs

PYTHON QUIZ

PYTHON QUIZ

University

5 Qs

PSPP-Unit 1-Quiz

PSPP-Unit 1-Quiz

University

10 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?