Python_Quiz_2(Datatypes)

Python_Quiz_2(Datatypes)

University

18 Qs

quiz-placeholder

Similar activities

2D Array and Strings in C

2D Array and Strings in C

University

16 Qs

Python-Lists_Dictionaries

Python-Lists_Dictionaries

University

20 Qs

Demo DS-A ASHV Quiz

Demo DS-A ASHV Quiz

University

17 Qs

Python 1.0

Python 1.0

10th Grade - University

20 Qs

CSC305: TOPIC 7

CSC305: TOPIC 7

University

15 Qs

Quizaro

Quizaro

University

20 Qs

PyTron

PyTron

University

15 Qs

loops and iterables in python

loops and iterables in python

University

20 Qs

Python_Quiz_2(Datatypes)

Python_Quiz_2(Datatypes)

Assessment

Quiz

Computers

University

Hard

Created by

Anil Chinchawade

Used 6+ times

FREE Resource

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

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?