
Week 7 Quiz

Quiz
•
Computers
•
University
•
Hard

Anthony G
FREE Resource
15 questions
Show all answers
1.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
Which of the following are true of Python lists?
A list may contain any type of object except another list
A given object may appear in a list more than once
All elements in a list must be of the same type
These represent the same list:
['a', 'b', 'c']
['c', 'a', 'b']
There is no conceptual limit to the size of a list
2.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Consider the following nested list definition:
x = [10, [3.141, 20, [30, 'baz', 2.718]], 'foo']
A schematic for this list is shown above:
What is the expression that returns the 'z' in 'baz'?
x[1][2][1]
x[1][2][1][2]
x[1][2][2]
x[1][1][2]
3.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Suppose you have the following tuple definition:
t = ('foo', 'bar', 'baz')
Which of the following statements replaces the second element ('bar') with the string 'qux':
t[1] = 'qux'
t(1) = 'qux'
t[1:1] = 'qux'
It’s a trick question—tuples can’t be modified.
4.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Pick the odd one in connection with collection data type
List
Tuple
Dictionary
Loop
5.
MULTIPLE CHOICE QUESTION
20 sec • 1 pt
Which of the following function is used to count the number of elements in a list ?
count( )
find( )
len( )
index( )
6.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
Let list1=[2,4,6,8,10] the print(list1[-2]) will result in
10
8
4
6
7.
MULTIPLE CHOICE QUESTION
10 sec • 1 pt
What is the use of type( ) function in python ?
To create a tuple
To know the type of an element in tuple
To know the data type of the Python object
To create a List
Create a free account and access millions of resources
Similar Resources on Wayground
10 questions
Object Oriented Programming

Quiz
•
University
10 questions
Unit 2 Python

Quiz
•
University
13 questions
JavaScript

Quiz
•
University
20 questions
Python Programming Quiz

Quiz
•
9th Grade - University
20 questions
Python Basics 1

Quiz
•
University
10 questions
python quiz

Quiz
•
6th Grade - Professio...
10 questions
basic programming quiz

Quiz
•
University
12 questions
kotlin Quiz 2

Quiz
•
University
Popular Resources on Wayground
10 questions
Lab Safety Procedures and Guidelines

Interactive video
•
6th - 10th Grade
10 questions
Nouns, nouns, nouns

Quiz
•
3rd Grade
10 questions
9/11 Experience and Reflections

Interactive video
•
10th - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
11 questions
All about me

Quiz
•
Professional Development
22 questions
Adding Integers

Quiz
•
6th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
9 questions
Tips & Tricks

Lesson
•
6th - 8th Grade
Discover more resources for Computers
21 questions
Spanish-Speaking Countries

Quiz
•
6th Grade - University
20 questions
Levels of Measurements

Quiz
•
11th Grade - University
7 questions
Common and Proper Nouns

Interactive video
•
4th Grade - University
12 questions
Los numeros en español.

Lesson
•
6th Grade - University
7 questions
PC: Unit 1 Quiz Review

Quiz
•
11th Grade - University
7 questions
Supporting the Main Idea –Informational

Interactive video
•
4th Grade - University
12 questions
Hurricane or Tornado

Quiz
•
3rd Grade - University
7 questions
Enzymes (Updated)

Interactive video
•
11th Grade - University