Python debugging

Quiz
•
Computers
•
University
•
Hard
vijayanandh ece
Used 259+ times
FREE Resource
10 questions
Show all answers
1.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
Find the output of the code:
# abc.py
def func(n):
return n + 10
func('Hello')
2.
FILL IN THE BLANK QUESTION
30 sec • 1 pt
Find the output of the code:
nameList = ['Harsh', 'Pratik', 'Bob', 'Dhruv']
print nameList[1][-1]
3.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output of the code:
for i in range(2):
print i
for i in range(4,6):
print i
0,1,4,5
0,1,2,4,5,6
0,1,2,3,4,5,6
2,4,6
4.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output of the code:
geekCodes = [1, 2, 3, 4]
geekCodes.append([5,6,7,8])
print len(geekCodes)
4
5
6
8
5.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output of the code:
check1 = ['Learn', 'Quiz', 'Practice', 'Contribute']
check2 = check1
check3 = check1[:]
check2[0] = 'Code'
check3[1] = 'Mcq'
count = 0
for c in (check1, check2, check3):
if c[0] == 'Code':
count += 1
if c[1] == 'Mcq':
count += 10
print count
10
11
12
13
6.
MULTIPLE SELECT QUESTION
30 sec • 1 pt
What is the output of the code:
d1 = {"john":40, "peter":45}
d2 = {"john":466, "peter":45}
print d1 > d2
True
False
Not applicable
7.
MULTIPLE CHOICE QUESTION
30 sec • 1 pt
Find the output of the code:
D = {1 : 1, 2 : '2', '1' : 1, '2' : 3}
D['1'] = 2
print(D[D[D[str(D[1])]]])
2
3
'2'
Key error
Create a free account and access millions of resources
Similar Resources on Wayground
12 questions
Python Quiz 1.4

Quiz
•
University
15 questions
Python Basics

Quiz
•
KG - University
15 questions
Scope of Variables in Python

Quiz
•
1st Grade - Professio...
10 questions
java quiz based on interface

Quiz
•
University
15 questions
GAGC-JAVA-SET1

Quiz
•
University
10 questions
Session 2 | U

Quiz
•
University
15 questions
PROGRAMMING IN PYTHON - UNIT II - TEST 1 MCQS

Quiz
•
University
15 questions
Exam 1 Practice

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