Compare commits
2 Commits
eeb100e485
...
7479a1034b
Author | SHA1 | Date |
---|---|---|
waldek | 7479a1034b | |
waldek | 7a187cd058 |
|
@ -69,6 +69,7 @@ There is a plethora of IDE's available and you can't really make a *wrong* choic
|
||||||
|
|
||||||
TODO animated overview of the shell and the world of OOP
|
TODO animated overview of the shell and the world of OOP
|
||||||
|
|
||||||
|
|
||||||
# Installing pycharm
|
# Installing pycharm
|
||||||
|
|
||||||
TODO
|
TODO
|
||||||
|
@ -168,6 +169,7 @@ print("Hello, my name is {} and I'm {} years old.".format(name, age))
|
||||||
## Some links to read up
|
## Some links to read up
|
||||||
|
|
||||||
* [realpython string formatting](https://realpython.com/python-string-formatting/)
|
* [realpython string formatting](https://realpython.com/python-string-formatting/)
|
||||||
|
* [realpython data types](https://realpython.com/python-data-types/)
|
||||||
|
|
||||||
# Taking input
|
# Taking input
|
||||||
|
|
||||||
|
@ -363,27 +365,34 @@ True
|
||||||
|
|
||||||
⛑ **Remember CTRL-q opens the documentation in Pycharm and don't forget to actually use it!**
|
⛑ **Remember CTRL-q opens the documentation in Pycharm and don't forget to actually use it!**
|
||||||
|
|
||||||
|
## Some links to read up on
|
||||||
|
|
||||||
|
* [realpython](https://realpython.com/python-conditional-statements/) conditional logic
|
||||||
|
|
||||||
# Coding challenge - Celsius to Fahrenheit converter
|
# Coding challenge - Celsius to Fahrenheit converter
|
||||||
|
|
||||||
Your first challenge!
|
Your first challenge!
|
||||||
I would like you to write a program that converts celcius to farenheit.
|
I would like you to write a program that converts Celsius to Fahrenheit.
|
||||||
The result of this program *could* be as follows.
|
The result of this program *could* be as follows.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
➜ ~ git:(master) ✗ python3 ex_celcius_to_farenheit.py
|
➜ ~ git:(master) ✗ python3 ex_celcius_to_fahrenheit.py
|
||||||
What's the temperature?30
|
What's the temperature?30
|
||||||
30°C equals 86.0°F
|
30°C equals 86.0°F
|
||||||
Go turn off the heating!
|
Go turn off the heating!
|
||||||
➜ ~ git:(master) ✗ python3 ex_celcius_to_farenheit.py
|
➜ ~ git:(master) ✗ python3 ex_celcius_to_fahrenheit.py
|
||||||
What's the temperature?4
|
What's the temperature?4
|
||||||
4°C equals 39.2°F
|
4°C equals 39.2°F
|
||||||
Brrrr, that's cold!
|
Brrrr, that's cold!
|
||||||
➜ ~ git:(master) ✗ python3 ex_celcius_to_farenheit.py
|
➜ ~ git:(master) ✗ python3 ex_celcius_to_fahrenheit.py
|
||||||
What's the temperature?blabla
|
What's the temperature?blabla
|
||||||
I can't understand you...
|
I can't understand you...
|
||||||
➜ ~ git:(master) ✗
|
➜ ~ git:(master) ✗
|
||||||
```
|
```
|
||||||
|
|
||||||
|
If you want to make the program a bit more complex, try adding the reverse as in Fahrenheit to Celsius.
|
||||||
|
Your first question to the user could then be *in which direction do you want to convert?*.
|
||||||
|
|
||||||
<details>
|
<details>
|
||||||
<summary>Spoiler warning</summary>
|
<summary>Spoiler warning</summary>
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue