What will be the output?
var1=['sam', "Pam", 12,44]
var1[3]="Ram"
print(var1)
Python list and tuple
Quiz
•
Computers
•
6th - 8th Grade
•
Hard
Sahana Karunakar
Used 180+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output?
var1=['sam', "Pam", 12,44]
var1[3]="Ram"
print(var1)
['sam', 'Pam', 12, 44]
['sam', 'Pam', 12, 'Ram']
It will give an error
['sam', 'Pam', 'Ram',44]
2.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output?
tuple1=['sam', "Pam", 12,44]
print(type(tuple1))
<class 'list'>
<class 'tuple'>
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output?
list1=['sam', "Pam", 12,44]
print(list1[-1])
12
sam
No such index in the list
44
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output?
list1=["Red","Green","Blue","Yellow"]
list1.append("Black")
print(list1)
<class 'list'>
['Red', 'Green', 'Blue', 'Yellow', 'Black']
['Black','Red', 'Green', 'Blue', 'Yellow' ]
AttributeError: 'tuple' object has no attribute 'append'
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Which of the statements are true for the code below:
list1=["Red","Green","Yellow","Orange","Black"]
if "Red" in list1 and "Green" in list1 and "Yellow" in list1:
print("We have all the colors of traffic lights")
Print statement will be executed if the list has red/yellow/Blue
Print statement will be executed if the list has all the three colors
It will give syntax error
None of these
6.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
What will be the output?
list1=["Red","Green","Yellow","Orange","Black","Emerald blue"]
print(max(list1))
Emerald blue
Black
Red
Yellow
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
list1=["Red","Green","Yellow","Orange","Black","Emerald blue"]
list1.sort()
print(list1)
["Red","Green","Yellow","Orange","Black","Emerald blue"]
Not a valid function in Python3
['Black', 'Emerald blue', 'Green', 'Orange', 'Red', 'Yellow']
None
10 questions
Lesson 16 - ASCII - Spaced Quiz
Quiz
•
7th Grade
9 questions
G(7) Quiz#4 - L3.4
Quiz
•
7th Grade
14 questions
Text Formatting and Alignment
Quiz
•
7th Grade
10 questions
Animation 1
Quiz
•
6th Grade
11 questions
Typing words on keyboard (colours)
Quiz
•
KG - Professional Dev...
10 questions
Списки Python + Pygame
Quiz
•
KG - University
15 questions
Computer Graphics
Quiz
•
7th - 11th Grade
12 questions
Robotics - Light Sensor
Quiz
•
6th Grade
15 questions
Character Analysis
Quiz
•
4th Grade
17 questions
Chapter 12 - Doing the Right Thing
Quiz
•
9th - 12th Grade
10 questions
American Flag
Quiz
•
1st - 2nd Grade
20 questions
Reading Comprehension
Quiz
•
5th Grade
30 questions
Linear Inequalities
Quiz
•
9th - 12th Grade
20 questions
Types of Credit
Quiz
•
9th - 12th Grade
18 questions
Full S.T.E.A.M. Ahead Summer Academy Pre-Test 24-25
Quiz
•
5th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
14 questions
Misplaced and Dangling Modifiers
Quiz
•
6th - 8th Grade
20 questions
Final Exam Vocabulary
Quiz
•
6th Grade
17 questions
Parts of Speech
Quiz
•
7th - 12th Grade
11 questions
Decimal/fraction conversions quick check
Quiz
•
5th - 7th Grade
10 questions
Identifying equations
Quiz
•
KG - University
44 questions
El fin del año- 7th
Quiz
•
7th - 12th Grade
40 questions
Word Study Assessment: Roots, Prefixes, Suffixes, and Vocabulary
Quiz
•
8th Grade
49 questions
How Well Do You Know Your 6th Grade Teachers?
Quiz
•
6th Grade