
Pyhton Debugging Questions

Quiz
•
Information Technology (IT)
•
University
•
Hard
Srilekha Karthick
Used 5+ times
FREE Resource
25 questions
Show all answers
1.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
1. What will the following code output?
x = 10
print(x) # Print the current value of x
x += 1 # Increment x
# if you wanted to replicate the post increment behavior exactly in python
# you would do the following.
x2 = 10
print(x2)
x2 = x2 + 1
11
10
Compilation error
Runtime error
2.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will this code print?
a = 10
b = 0
try:
print(a / b)
except ZeroDivisionError:
print("Error")
Error
Infinity
0
1
3.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What is the output of this code?
a = 7
b = 3
print(a % b)
2
1
0
3
4.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following Python program?
try:
x = 5/0 except Zero DivisionError:
print("Error: Division by zero is not allowed.")
5
0
Error: Division by zero is not allowed.
None
5.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following Python program?
try:
x = [1, 2, 3] print(x[5]) except IndexError:
print("Error: Index out of range.")
1
2
3
Error: Index out of range.
6.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following Python program?
try: x = "hello" print(x[10]) except IndexError:
print("Error: Index out of range.")
'h'
'o'
Error: Index out of range.
None
7.
MULTIPLE CHOICE QUESTION
45 sec • 1 pt
What will be the output of the following Python program?
try:
x = 5
y = "hello"
print(x + y)
except TypeError:
print("Error: Invalid data type.")
5hello
hello5
Error: Invalid data type.
None
Create a free account and access millions of resources
Similar Resources on Wayground
20 questions
Виключення в Python

Quiz
•
University
20 questions
Функції у Python. Частина 2

Quiz
•
University
30 questions
EVALUASI TENGAH SEMESTER GENAP

Quiz
•
10th Grade - University
20 questions
Database quiz part 1 - D2T4

Quiz
•
University
25 questions
Codean - Java Data Types

Quiz
•
University
30 questions
Introducción a la Sintaxis de Python

Quiz
•
University
30 questions
Exploring Python Fundamentals

Quiz
•
University
21 questions
E5-1 Data Processing CE2

Quiz
•
9th Grade - University
Popular Resources on Wayground
20 questions
Brand Labels

Quiz
•
5th - 12th Grade
10 questions
Ice Breaker Trivia: Food from Around the World

Quiz
•
3rd - 12th Grade
25 questions
Multiplication Facts

Quiz
•
5th Grade
20 questions
ELA Advisory Review

Quiz
•
7th Grade
15 questions
Subtracting Integers

Quiz
•
7th Grade
22 questions
Adding Integers

Quiz
•
6th Grade
10 questions
Multiplication and Division Unknowns

Quiz
•
3rd Grade
10 questions
Exploring Digital Citizenship Essentials

Interactive video
•
6th - 10th Grade
Discover more resources for Information Technology (IT)
11 questions
NFL Football logos

Quiz
•
KG - Professional Dev...
20 questions
Definite and Indefinite Articles in Spanish (Avancemos)

Quiz
•
8th Grade - University
7 questions
Force and Motion

Interactive video
•
4th Grade - University
36 questions
Unit 5 Key Terms

Quiz
•
11th Grade - University
38 questions
Unit 6 Key Terms

Quiz
•
11th Grade - University
20 questions
La Hora

Quiz
•
9th Grade - University
7 questions
Cell Transport

Interactive video
•
11th Grade - University
7 questions
What Is Narrative Writing?

Interactive video
•
4th Grade - University