dde272c4b8
i18n - Build Validation / Validate i18n Builds (24) (push) Has been cancelled
CI - Node.js / Lint (24) (push) Has been cancelled
CI - Node.js / Build (24) (push) Has been cancelled
CI - Node.js / Test (24) (push) Has been cancelled
CI - Node.js / Test - Upcoming Changes (24) (push) Has been cancelled
CI - Node.js / Test - i18n (italian, 24) (push) Has been cancelled
CI - Node.js / Test - i18n (portuguese, 24) (push) Has been cancelled
CD - Docker - GHCR Images / Build and Push Images (push) Has been cancelled
46 lines
727 B
Markdown
46 lines
727 B
Markdown
---
|
|
id: 2a486e3e521b79b874fb5e9a
|
|
title: Try/Except
|
|
challengeType: 11
|
|
videoId: 1tkhMom_SZw
|
|
dashedName: try-except
|
|
---
|
|
|
|
# --description--
|
|
|
|
In this video, you will learn how to handle exceptions using try/except blocks to make your programs more robust.
|
|
|
|
# --questions--
|
|
|
|
## --text--
|
|
|
|
What will be the result for the following code if the user provides the string `"random"`?
|
|
|
|
```python
|
|
try:
|
|
number = int(input("Enter a number: "))
|
|
print(number)
|
|
except:
|
|
print("Invalid Input")
|
|
```
|
|
|
|
## --answers--
|
|
|
|
Nothing will be output to the console.
|
|
|
|
---
|
|
|
|
The string `"random"` will be output to the console.
|
|
|
|
---
|
|
|
|
The string `"Invalid Input"` will be output to the console.
|
|
|
|
---
|
|
|
|
The program will crash.
|
|
|
|
## --video-solution--
|
|
|
|
3
|