2020-04-06 14:49:56 -04:00
|
|
|
---
|
|
|
|
id: 5e7b9f060b6c005b0e76f059
|
2020-04-21 23:37:02 -05:00
|
|
|
title: More Conditional Structures
|
2020-04-06 14:49:56 -04:00
|
|
|
challengeType: 11
|
2020-05-25 19:15:32 +05:30
|
|
|
isHidden: true
|
2020-04-06 14:49:56 -04:00
|
|
|
isRequired: true
|
|
|
|
videoId: HdL82tAZR20
|
|
|
|
---
|
|
|
|
|
|
|
|
## Description
|
|
|
|
<section id='description'>
|
|
|
|
More resources:
|
|
|
|
- <a href="https://www.youtube.com/watch?v=crLerB4ZxMI" target='_blank'>Exercise 1</a>
|
|
|
|
- <a href="https://www.youtube.com/watch?v=KJN3-7HH6yk" target='_blank'>Exercise 2</a>
|
|
|
|
</section>
|
|
|
|
|
|
|
|
## Tests
|
|
|
|
<section id='tests'>
|
|
|
|
|
|
|
|
```yml
|
|
|
|
question:
|
2020-05-31 13:57:09 +01:00
|
|
|
text: |
|
|
|
|
Given the following code:
|
|
|
|
```python
|
|
|
|
temp = "5 degrees"
|
|
|
|
cel = 0
|
|
|
|
try:
|
|
|
|
fahr = float(temp)
|
|
|
|
cel = (fahr - 32.0) * 5.0 / 9.0
|
|
|
|
except:
|
|
|
|
print("temp should be a number")
|
|
|
|
print(cel)
|
|
|
|
```
|
|
|
|
Which line would cause the script to immediately stop because of an error?
|
|
|
|
|
2020-04-06 14:49:56 -04:00
|
|
|
answers:
|
2020-05-31 13:57:09 +01:00
|
|
|
- |
|
|
|
|
1
|
|
|
|
- |
|
|
|
|
4
|
|
|
|
- |
|
|
|
|
6
|
|
|
|
- |
|
|
|
|
7
|
|
|
|
- |
|
|
|
|
None
|
2020-04-06 14:49:56 -04:00
|
|
|
solution: 2
|
|
|
|
```
|
|
|
|
|
|
|
|
</section>
|