python quiz

python quiz

University

12 Qs

quiz-placeholder

Similar activities

Week 7 Quiz

Week 7 Quiz

University

15 Qs

Q2 - Python

Q2 - Python

University

10 Qs

Tuples and set

Tuples and set

University

10 Qs

Python

Python

7th Grade - University

10 Qs

Python Lists and Tuples

Python Lists and Tuples

University

11 Qs

Python

Python

University

15 Qs

Python Programming Concepts Challenge

Python Programming Concepts Challenge

10th Grade - University

10 Qs

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

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

9th Grade - University

8 Qs

python quiz

python quiz

Assessment

Quiz

Computers

University

Hard

Created by

Sujata B

Used 2+ times

FREE Resource

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

To which of the following the "in" operator can be used to check if an item is in it?

lists

tuples

dictionaries

All of the above

2.

MULTIPLE CHOICE QUESTION

20 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

10 sec • 1 pt

What will be the output of the following Python code?

d = {"john":40, "peter":45}

d["john"]

40

50

"jhon"

"peter"

4.

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]

5.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

How do you add an element to end of list in python?

list.add(element)

list.append(0,element)

list.append(element)

list.extend(element)

6.

MULTIPLE CHOICE QUESTION

10 sec • 1 pt

How do you find the number of elements in a list in python?

list.size()

list.count()

list.length()

len(list)

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

what is the result of the following code:

list1=[1,2,3]

list2=list1

list2[1]=4

print(list1)

[1,2,3]

[1,4,3]

[4,2,3]

error

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?