1. Find the output of the following program:
nameList = ['Harsh', 'Pratik', 'Bob', 'Dhruv']
print nameList[1][-1]
PYTHON QUIZ3
Quiz
•
Computers
•
University - Professional Development
•
Hard
MSK PSGRKCW
Used 6+ times
FREE Resource
10 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
1. Find the output of the following program:
nameList = ['Harsh', 'Pratik', 'Bob', 'Dhruv']
print nameList[1][-1]
h
k
v
b
2.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
2. Find the output of the following program:
input = [1, 2, 3, 4]
input. append([5,6,7,8])
print(input)
[1,2,3,4,5,6,7,8]
[1,2,3,4]
[1,2,3,4,[5,6,7,8]]
[1,2,3,4][5,6,7,8]
3.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
3. Find the output of the following program:
list1 = range(100, 110)
print (list1.index(105))
105
5
106
4
4.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
4. Find the output of the following program
list1 = [1, 2, 3, 4, 5]
list2 = list1
list2[0] = 0;
print( list1)
[1, 2, 3, 4, 5, 0]
[0,1, 2, 3, 4, 5]
[0, 2, 3, 4, 5]
[1, 2, 3, 4, 0]
5.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
5. Find the output of the following code
list1 = [1998, 2002]
list2 = [2014, 2016]
print ((list1 + list2)*2)
[1998, 2002, 2014, 2016, 1998, 2002, 2014, 2016]
[1998, 2002, 2014, 2016]
[1998, 2002, 1998, 2002]
[2014, 2016, 2014, 2016]
6.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
6. A Program Runs And, During Running, Is Asked To Divide By Zero. The Program Crashes. This Is An Example Of ----------
Runtime Error
Logic Error
Syntax Error
semantic Error
7.
MULTIPLE CHOICE QUESTION
1 min • 1 pt
7. What will be output for the folllowing code?
try:
print(x)
except:
print("An exception occurred")
x
An exception occurred
Error
None of the above
10 questions
2-列表与元组
Quiz
•
University
12 questions
Python list starter
Quiz
•
10th Grade - University
10 questions
Java quiz based on inheritance
Quiz
•
University
10 questions
Python
Quiz
•
University
10 questions
MCQ Questions- List
Quiz
•
University
10 questions
Struktur Data
Quiz
•
University
10 questions
set - 13
Quiz
•
University
10 questions
Python - Functions
Quiz
•
University
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