Python_Quiz_2(Datatypes)

Python_Quiz_2(Datatypes)

University

18 Qs

quiz-placeholder

Similar activities

Sains Komputer Tingkatan 4 - 2.2.3 Menghasilkan gambar rajah

Sains Komputer Tingkatan 4 - 2.2.3 Menghasilkan gambar rajah

1st Grade - Professional Development

14 Qs

PWM y ADC con el MSP430F5529

PWM y ADC con el MSP430F5529

University

13 Qs

Text me!

Text me!

University

20 Qs

Bloque 3: Programación de dispositivos

Bloque 3: Programación de dispositivos

University

20 Qs

DCN5511: Chapter 5 - 7

DCN5511: Chapter 5 - 7

University

15 Qs

Control Structures  C#

Control Structures C#

University

20 Qs

Basic Excel

Basic Excel

University

15 Qs

YAY! Fridate with ComSSA (Network 101)

YAY! Fridate with ComSSA (Network 101)

University

20 Qs

Python_Quiz_2(Datatypes)

Python_Quiz_2(Datatypes)

Assessment

Quiz

Computers

University

Practice Problem

Hard

Created by

Anil Chinchawade

Used 6+ times

FREE Resource

AI

Enhance your content in a minute

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

18 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

In this list, how will you access the letter ‘g’ in ‘bat’?

list1 = [1,['a','b',['orchid', 'college', 'Solapur'],'c'],3]

list1[1, 2, 1, 5]

list1[2][1][5]

list1[1][2][1][5]

list1[1][5][1]

2.

MULTIPLE SELECT QUESTION

1 min • 1 pt

What is the value of y?

>>> x, y, z = (1,2,3,4,5,6,7,8,9,10)[2::3]

2

5

6

This code raises an exception

3.

MULTIPLE SELECT QUESTION

1 min • 1 pt

In the following code, how many objects and references does Python create?

name = "Orchid"

college_name = name

One object, one reference

One object, two references

Two objects, one reference

Two objects, two references

4.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is the output of the following code?

>>> list = ['a','b','c']

>>> list += 'de'

>>> print(list)

[‘a’, ‘b’, ‘c’, ‘d’, ‘e’]

[‘a’, ‘b’, ‘c’, ‘de’]

[‘ade’, ‘bde’, ‘cde’]

This raises an exception because we cannot add a string to a list

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

How will you cannot create a dictionary?

d = {'milk': 50, 'celery': 40}

d = dict(milk=50, celery=40)

d = dict([ ('milk', 50), ('celery', 40) ])

d = { ('milk', 50), ('celery', 40) }

d = {} d['milk'] = 50 d['celery'] = 40

6.

MULTIPLE CHOICE QUESTION

2 mins • 1 pt

Media Image

In the following code, how will you get to the value 7?

list[‘cheese’][‘spoons’]

list[2][‘utensils’][‘spoons’]

list[‘spoons’]

list[‘utensils’][‘spoons’]

7.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Which of these can you use as a dictionary key?

Please select 2 correct answers

‘key’

{‘a’:1, ‘b’:2}

[‘1’,’2’]

(‘key’, ‘value’)

5j

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?

Discover more resources for Computers