Which of the following creates a tuple?

Python Test 25 List Tuple Dictionary

Quiz
•
Computers
•
Professional Development
•
Hard
ram lovewanshi
Used 40+ times
FREE Resource
70 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
tuple1=("a","b")
tuple1[2]=("a","b")
tuple1=(5)*2
None of the above
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
Choose the correct option with respect to Python.
Both tuples and lists are immutable.
Tuples are immutable while lists are mutable.
Both tuples and lists are mutable.
Tuples are mutable while lists are immutable.
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
colors = ["red", "green", "burnt sienna", "blue"]
print(colors[2])
What is the output of the above python code?
'blue'
It causes a run-time error.
'burnt sienna'
'green'
4.
FILL IN THE BLANK QUESTION
1 min • 1 pt
colors = ["red", "green", "burnt sienna", "blue"]
Which list index would select the value 'red' from the above list?
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
colors = ("red", "green", "burnt sienna", "blue")
print("yellow" in colors)
What is the result of the yellow in colors expression?
ValueError: 'yellow' is not in list
4
False
True
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
What’s the main difference between Python lists and tuples?
Lists can hold any data type and tuples can only contain int and str objects.
Lists are immutable and tuples are mutable.
Lists are mutable and tuples are immutable.
Lists are faster and tuples are slower.
Check Your Answer »
7.
MULTIPLE CHOICE QUESTION
1 min • 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]
Create a free account and access millions of resources
Similar Resources on Wayground
70 questions
Object oriented Programming

Quiz
•
Professional Development
70 questions
Servlets, JSP & XML

Quiz
•
Professional Development
75 questions
Tin học nâng cao Module 09.1 - Trung Đức Nguyễn

Quiz
•
Professional Development
65 questions
Desarrollador prueba1

Quiz
•
Professional Development
72 questions
generate random number + java

Quiz
•
Professional Development
71 questions
PROTOCOLOS-2-ESPAÑOL

Quiz
•
University - Professi...
70 questions
1ºDAM/DAW - Sistemas Informáticos - UD5-UD7 - Prof. C. Boni

Quiz
•
University - Professi...
72 questions
WP 16-23

Quiz
•
Professional Development
Popular Resources on Wayground
25 questions
Equations of Circles

Quiz
•
10th - 11th Grade
30 questions
Week 5 Memory Builder 1 (Multiplication and Division Facts)

Quiz
•
9th Grade
33 questions
Unit 3 Summative - Summer School: Immune System

Quiz
•
10th Grade
10 questions
Writing and Identifying Ratios Practice

Quiz
•
5th - 6th Grade
36 questions
Prime and Composite Numbers

Quiz
•
5th Grade
14 questions
Exterior and Interior angles of Polygons

Quiz
•
8th Grade
37 questions
Camp Re-cap Week 1 (no regression)

Quiz
•
9th - 12th Grade
46 questions
Biology Semester 1 Review

Quiz
•
10th Grade