
Python_Quiz_2(Datatypes)

Quiz
•
Computers
•
University
•
Hard
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
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
Similar Resources on Wayground
20 questions
Code Junction 4

Quiz
•
University
20 questions
AlgoProg - Review Quiz

Quiz
•
University
14 questions
Data Structure

Quiz
•
University
17 questions
QUEUE

Quiz
•
University
15 questions
PyTron

Quiz
•
University
16 questions
Fundamentos de Python

Quiz
•
University
21 questions
COMP1010 Week 4 Quiz - Edit to streamline!

Quiz
•
University
15 questions
Python challange

Quiz
•
University
Popular Resources on Wayground
10 questions
Video Games

Quiz
•
6th - 12th Grade
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
15 questions
Core 4 of Customer Service - Student Edition

Quiz
•
6th - 8th Grade
15 questions
What is Bullying?- Bullying Lesson Series 6-12

Lesson
•
11th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Computers
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
7 questions
Figurative Language: Idioms, Similes, and Metaphors

Interactive video
•
4th Grade - University
15 questions
Properties of Equality

Quiz
•
8th Grade - University
38 questions
WH - Unit 3 Exam Review*

Quiz
•
10th Grade - University
21 questions
Advise vs. Advice

Quiz
•
6th Grade - University
12 questions
Reading a ruler!

Quiz
•
9th Grade - University