Python - List and Tuples

Python - List and Tuples

11th - 12th Grade

20 Qs

quiz-placeholder

Similar activities

Python Lists

Python Lists

10th - 12th Grade

15 Qs

XII - CS - Lesson 9 - Tuple - Quiz 4

XII - CS - Lesson 9 - Tuple - Quiz 4

12th Grade

20 Qs

Python Lists and Tuples

Python Lists and Tuples

11th - 12th Grade

20 Qs

Python Quiz

Python Quiz

12th Grade

15 Qs

Kuis Python 1

Kuis Python 1

11th Grade

15 Qs

List and Tuples

List and Tuples

9th - 12th Grade

22 Qs

List Manipulations

List Manipulations

11th Grade

20 Qs

Tuples Mastery

Tuples Mastery

11th - 12th Grade

15 Qs

Python - List and Tuples

Python - List and Tuples

Assessment

Quiz

Computers

11th - 12th Grade

Hard

Created by

Sreelekshmi S

Used 206+ times

FREE Resource

20 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following piece of code when executed in Python shell?


>>> a=("Check")*3

>>> a



(‘Check’,’Check’,’Check’)

* Operator not valid for tuples

(‘CheckCheckCheck’)

Syntax error

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Is the following piece of code valid?


>>> a=(1,2,3,4)

>>> del a

No because tuple is immutable

Yes, the entire tuple is deleted

No, invalid syntax for del method

Yes, first element in the tuple is deleted

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What type of data is: a=[(1,1),(2,4),(3,9)]?

Array of tuples

List of tuples

Tuples of lists

Invalid type

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is true for a tuple?

Tup = 1,2,3

Tup = (""1,"2)

Tup = (1,2,3,4)

None of the above

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Result of the program above is

('1', '2', '3', '4', '5')

(1, 2, 3, 4, 5)

12345

"12345"

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose you have the following tuple definition:


t = ('foo', 'bar', 'baz')


Which of the following statements replaces the second element ('bar') with the string 'qux':

t[1] = 'qux'

t(1) = 'qux'

t[1:1] = 'qux'

error

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

If list=[17,23,41,10] then list.append(32) will result

[32,17,23,41,10]

[17,23,41,10,32]

[10,17,23,32,41]

[41,32,23,17,10]

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?