fix: more conditional structures python (#38981)

This commit is contained in:
Nitesh Seram
2020-06-06 15:20:30 +05:30
committed by GitHub
parent 89d5c891e3
commit 10b0c9ed94

View File

@ -8,6 +8,7 @@ videoId: HdL82tAZR20
--- ---
## Description ## Description
<section id='description'> <section id='description'>
More resources: More resources:
- <a href="https://www.youtube.com/watch?v=crLerB4ZxMI" target='_blank'>Exercise 1</a> - <a href="https://www.youtube.com/watch?v=crLerB4ZxMI" target='_blank'>Exercise 1</a>
@ -15,36 +16,34 @@ More resources:
</section> </section>
## Tests ## Tests
<section id='tests'> <section id='tests'>
```yml ````yml
question: question:
text: | text: |
Given the following code: Given the following code:
```python ```python
temp = "5 degrees" temp = "5 degrees"
cel = 0 cel = 0
try: fahr = float(temp)
fahr = float(temp) cel = (fahr - 32.0) * 5.0 / 9.0
cel = (fahr - 32.0) * 5.0 / 9.0
except:
print("temp should be a number")
print(cel) print(cel)
``` ```
Which line would cause the script to immediately stop because of an error? Which line/lines should be surrounded by `try` block?
answers: answers:
- | - |
1 1
- |
3
- |
3,4
- | - |
4 4
- | - |
6 None
- | solution: 3
7 ````
- |
None
solution: 2
```
</section> </section>