Python Data types & Exceptions

Python Data types & Exceptions

1st - 10th Grade

14 Qs

quiz-placeholder

Similar activities

Diplo Alternativas

Diplo Alternativas

1st - 3rd Grade

10 Qs

Word 2016 Lesson 1

Word 2016 Lesson 1

9th - 12th Grade

10 Qs

Diagnoses and Identification of Faulty Computer and Network

Diagnoses and Identification of Faulty Computer and Network

9th Grade

10 Qs

Review PAT TIK kelas 5

Review PAT TIK kelas 5

5th Grade

10 Qs

L3 - B10

L3 - B10

3rd Grade

10 Qs

Numpy-1

Numpy-1

9th - 12th Grade

10 Qs

Types of Mass Media

Types of Mass Media

10th Grade - Professional Development

11 Qs

Common Protocols

Common Protocols

10th - 12th Grade

15 Qs

Python Data types & Exceptions

Python Data types & Exceptions

Assessment

Quiz

Computers

1st - 10th Grade

Practice Problem

Hard

Created by

Humera I

Used 33+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

14 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following Python code?

l1=[2,4,6]

l2=[-2,-4,-6]

for i in zip(l1, l2):

print(i)

2, -2

4, -4

6, -6

[(2, -2), (4, -4), (6, -6)]

(2, -2)

(4, -4)

(6, -6)

[-4, -16, -36]

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What will be the output of the following Python code?

a=[1,2,3]

b=a.append(4)

print(a)

print(b)

[1,2,3,4]

[1,2,3,4]

[1, 2, 3, 4]

None

Syntax error

[1,2,3]

[1,2,3,4]

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

What is the output of the following code

aTuple = (100, 200, 300, 400, 500)

aTuple[1] = 800

print(aTuple)

TypeError


(100, 800, 200, 300, 400, 500)

(800, 100, 200, 300, 400, 500)

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following tuple operation

aTuple = (100,)

print(aTuple * 2)

TypeError

(100, 100)

(200)

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Choose the correct way to access value 20 from the following tuple

aTuple = ("Orange", [10, 20, 30], (5, 15, 25))

aTuple[1:2][1]

aTuple[1:2](1)

aTuple[1:2][1]

aTuple[1][1]

6.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code

aTuple = (100, 200, 300, 400, 500)

print(aTuple[-2])

print(aTuple[-4:-1])

IndexError: tuple index out of range

400

(200, 300, 400)

(200,300,400)

300,400,500

7.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Suppose d = {“john”:40, “peter”:45}. To obtain the number of entries in dictionary which command do we use?

d.size()

len(d)

size(d)

d.len()

Create a free account and access millions of resources

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?