In this list, how will you access the letter ‘g’ in ‘bat’?
list1 = [1,['a','b',['orchid', 'college', 'Solapur'],'c'],3]
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
20 questions
[Python For All] Quiz 2 - Rewind.py
Quiz
•
University
15 questions
PyTron
Quiz
•
University
20 questions
Python-Lists_Dictionaries
Quiz
•
University
20 questions
Python Data Types Quiz
Quiz
•
10th Grade - University
15 questions
Python Variables
Quiz
•
University
17 questions
Demo DS-A ASHV Quiz
Quiz
•
University
16 questions
PAP Module-3 Part-2
Quiz
•
University
16 questions
Fundamentos de Python
Quiz
•
University
10 questions
Chains by Laurie Halse Anderson Chapters 1-3 Quiz
Quiz
•
6th Grade
20 questions
math review
Quiz
•
4th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
12 questions
Multiplying Fractions
Quiz
•
6th Grade
30 questions
Biology Regents Review #1
Quiz
•
9th Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
50 questions
Biology Regents Review: Structure & Function
Quiz
•
9th - 12th Grade
10 questions
Identifying equations
Quiz
•
KG - University
16 questions
Chapter 8 - Getting Along with your Supervisor
Quiz
•
3rd Grade - Professio...
6 questions
Railroad Operations and Classifications Quiz
Quiz
•
University
71 questions
Logos
Quiz
•
3rd Grade - University
8 questions
Mali - Geography
Quiz
•
University