Python_Quiz_2(Datatypes)

Python_Quiz_2(Datatypes)

University

18 Qs

quiz-placeholder

Similar activities

BÀI 14- THUẬT TOÁN TÌM KIẾM TUẦN TỰ

BÀI 14- THUẬT TOÁN TÌM KIẾM TUẦN TỰ

6th Grade - University

14 Qs

Memory-Mobo-Hard/Software

Memory-Mobo-Hard/Software

University

18 Qs

Linux: Users and Groups

Linux: Users and Groups

9th Grade - University

14 Qs

Archivos Digitales

Archivos Digitales

9th Grade - University

14 Qs

PARC Linux Basic Part 2

PARC Linux Basic Part 2

University

20 Qs

SQL Quiz

SQL Quiz

University

18 Qs

switch case

switch case

University

17 Qs

CORLANG Week6-7

CORLANG Week6-7

10th Grade - 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?