Help
Contact
For teachers and institutes
Search courses, problems, tests…
A
A
>_
StemPy Lab
Courses ▾
Problems ▾
Practice ▾
Mock Tests
Classes
Community ▾
A
A
Quizzes
/
A loop divides 12 by each value of a tuple. What happens when the program runs?
Python Programming
Medium
High School (11–12)
Python Essentials › Errors and Exceptions
Class 12 Board
PCAP (Python Institute)
+1 more exams
A-Level
A-Level
PCAP (Python Institute)
Created by
StemPy Lab
Stuck? Show a hint
A loop divides
12
by each value of a tuple.
data = (4, 0, "2") total = 0 for d in data: total += 12 // d print(total)
What happens when the program runs?
3
It stops with
ZeroDivisionError
It stops with
ValueError
It stops with
TypeError
Check Answer
Log in to save
Tag someone
⚑ Report
← All Quizzes
← Inside the folder kit there are two files: an __init__.py that sets a version number, and a module conv.py. The program main.py is next to that folder. kit/__init__.py: kit/conv.py: main.py: What does main.py print?
A loop raises three exceptions: a class with no brackets, an object with a message, and a KeyError object. What does the program print? →
More on
Python Essentials › Errors and Exceptions
Discussion (0)
Log in
to join the discussion.
Loading…
All questions on this topic →
Problems on this topic
Say which error each line gives, before you run it.
Easy
The data reader below reports each bad line with a message…
Medium
For each job, say whether you would look before you leap (an if) or try and catch (try and except)…
Easy
Write a function percent(part, total) that gives part / total * 100…
Medium
All problems on this topic →