fix first parts

This commit is contained in:
ducoterra
2020-10-25 21:30:59 -04:00
parent d15165b114
commit 1ceb488f21
2 changed files with 17 additions and 15 deletions

View File

@@ -24,9 +24,9 @@ Before we can dive into our web project we have to cover some Python basics. Let
8. Type `x="hello"` and press enter. Nothing should return. 8. Type `x="hello"` and press enter. Nothing should return.
9. Type `x` and press etner. You should see `hello` printed to the screen. Variables in python do not have a "type" - they can be integers, strings, floats, etc and can switch between them at will. 9. Type `x` and press enter. You should see `hello` printed to the screen. Variables in python do not have a "type" - they can be integers, strings, floats, etc and can switch between them at will.
10. Type `my_name = "\<your name here\>"` and press enter. Nothing should return 10. Type `my_name = "<your name here>"` and press enter. Nothing should return
11. Type `my_name` and press enter. You should see your name printed to your terminal. `my_name` is a much better variable name than `x`. It describes the thing it stores. Please use variable names that are descriptive. 11. Type `my_name` and press enter. You should see your name printed to your terminal. `my_name` is a much better variable name than `x`. It describes the thing it stores. Please use variable names that are descriptive.
@@ -40,15 +40,15 @@ Before we can dive into our web project we have to cover some Python basics. Let
16. Type `len(address)` and press enter. You should see `5` printed to the terminal. There are 5 "things" in the tuple: 16. Type `len(address)` and press enter. You should see `5` printed to the terminal. There are 5 "things" in the tuple:
`123 ` (1) (1) `123 `
`"lane ave"` (2) (2) `"lane ave"`
`"Columbus"` (3) (3) `**"Columbus"`
`"OH"` (4) (4) `"OH"`
`43212` (5) (5) `43212`
17. Type `address[0]` and press enter. You should see `123` printed to the terminal. You just accessed the first item in the tuple. Tuples and other collections start at 0 and count up. 17. Type `address[0]` and press enter. You should see `123` printed to the terminal. You just accessed the first item in the tuple. Tuples and other collections start at 0 and count up.
@@ -64,7 +64,7 @@ Before we can dive into our web project we have to cover some Python basics. Let
## A Python Program ## A Python Program
1. Create a new file called `myprogram.py` by clicking the "add file" icon in the top left of VSCode. 1. Create a new file called `my_program.py` by clicking the "add file" icon in the top left of VSCode.
![add_file](img/day1/add_file.png) ![add_file](img/day1/add_file.png)
@@ -99,7 +99,7 @@ Before we can dive into our web project we have to cover some Python basics. Let
![type_more_code](img/day1/type_more_code.png) ![type_more_code](img/day1/type_more_code.png)
1. In your terminal type `python myprogram.py` and press enter. You should see 1. Save the file with <kbd>ctrl</kbd>+<kbd>S</kbd>. In your terminal type `python myprogram.py` and press enter. You should see
```bash ```bash
hello, world! hello, world!
@@ -130,6 +130,8 @@ Before we can dive into our web project we have to cover some Python basics. Let
1. Now type `python my_program.py` in the terminal and press enter. Nothing will return. 1. Now type `python my_program.py` in the terminal and press enter. Nothing will return.
![functions_in_order](img/day1/functions_in_order.png)
1. We've given our snippets of code "names" by adding a "def" above them. These are called functions. We can call them in any order we want. Let's call them in the correct order by using their names. Add the following to the bottom of my_program.py 1. We've given our snippets of code "names" by adding a "def" above them. These are called functions. We can call them in any order we want. Let's call them in the correct order by using their names. Add the following to the bottom of my_program.py
```python ```python
@@ -138,6 +140,6 @@ Before we can dive into our web project we have to cover some Python basics. Let
print_goodbye() print_goodbye()
``` ```
![functions_in_order](img/day1/functions_in_order.png) 3. Type `python my_program.py` in the terminal and press enter. Now everything prints in order!
1. Type `python my_program.py` in the terminal and press enter. Now everything prints in order! ![in_order](img/day1/in_order.png)

BIN
docs/img/day1/in_order.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 183 KiB