Python list and tuple

Quiz
•
Computers
•
6th - 8th Grade
•
Hard
Sahana Karunakar
Used 181+ 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
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Python

Quiz
•
7th - 8th Grade
10 questions
MOAC Excel 2016 Lesson 03

Quiz
•
8th - 12th Grade
10 questions
Mastering Python List Operations

Quiz
•
7th Grade
10 questions
Arrays and Lists

Quiz
•
6th - 12th Grade
15 questions
COREL QUIS 1

Quiz
•
7th Grade
15 questions
Python

Quiz
•
6th Grade - University
11 questions
Проверим, как вы знаете Python

Quiz
•
6th Grade
13 questions
Scratch Programming

Quiz
•
1st - 12th Grade
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
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
20 questions
typing

Quiz
•
6th Grade
18 questions
Company Logos

Quiz
•
6th - 8th Grade
10 questions
Proper Keyboarding Techniques

Interactive video
•
6th - 10th Grade
14 questions
Inputs and Outputs: Computer Science Intro

Lesson
•
5th - 9th Grade
20 questions
Input, Output, Processing or Storage

Quiz
•
5th - 6th Grade
10 questions
Understanding Computers: Hardware, Software, and Operating Systems

Interactive video
•
7th - 12th Grade