Pyhton Debugging Questions

Pyhton Debugging Questions

University

25 Qs

quiz-placeholder

Similar activities

Basic HTML

Basic HTML

University

20 Qs

PROGRAMMING 1

PROGRAMMING 1

University

20 Qs

Quiz tentang App Inventor

Quiz tentang App Inventor

11th Grade - University

21 Qs

Advanced Java UNIT-2(J2EE)-Quiz-4

Advanced Java UNIT-2(J2EE)-Quiz-4

University

20 Qs

Database 1

Database 1

University

20 Qs

Quiz tentang Personal Branding dan AI

Quiz tentang Personal Branding dan AI

University

20 Qs

Kuis Data Science Pertemuan 3

Kuis Data Science Pertemuan 3

University

20 Qs

OSS (QUIZ 7) Input/Output Systems

OSS (QUIZ 7) Input/Output Systems

University

20 Qs

Pyhton Debugging Questions

Pyhton Debugging Questions

Assessment

Quiz

Information Technology (IT)

University

Hard

Created by

Srilekha Karthick

Used 5+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

By signing up, you agree to our Terms of Service & Privacy Policy

Already have an account?