Skip to content
CodeWiki
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
Search
⌘K
English
English
Chinese
Practice
Paths
Tracks
Cheatsheets
Playground
Glossary
AI era
English
English
Chinese
Practice
/
Quiz
/
Python
/
Python fundamentals
Which try suite best handles conversion of one user-supplied quantity?
from Python fundamentals
Python 3.14
beginner
2 min
Which try suite best handles conversion of one user-supplied quantity?
Wrap only int(raw_quantity) and catch ValueError at the input boundary.
Wrap the whole request and catch Exception, returning zero for every failure.
Parse the exception message to decide whether conversion failed.
Catch BaseException so cancellation and process-exit signals become invalid input.
Check
Ask AI about this kata
Report an error
previous kata
What does configured_port or 8000 return when configured_port is 0?
Quiz
next kata
What does this program print?
Predict the output
A new version is available
Reload