Search Header Logo

tuples in python

Authored by Kanika Ahluwalia

Computers

11th Grade

Used 51+ times

tuples in python
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

15 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Which of the following is a Python tuple?

[1,2,3]

(1,2,3)

{1,2,3}

{}

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?


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

>>>t[1:3]

(1,2)

(1,2,4)

(2,4)

(2,4,3)

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?


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

>>>t[1:-1]

(1,2)

(1,2,4)

(2,4)

(2,4,3)

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?


>>>t = (1, 2, 4, 3, 8, 9)

>>> for i in range(0, len(t), 2):

print(t[i])

[2,3,9]

[1,2,4,3,8,9]

[1,4,8]

Error

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?


>>>t = (1, 2)

>>>2 * t

(1,2,1,2)

[1,2,1,2]

[1,1,2,2]

(1,1,2,2)

6.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?


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

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

>>>t1 < t2

True

False

Error

None

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What will be the output of the following Python code?


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

>>>my_tuple.append( (5, 6, 7) )

>>>print len(my_tuple)

1

2

5

Error

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?