fix first parts
This commit is contained in:
32
docs/day1.md
32
docs/day1.md
@@ -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.
|
||||
|
||||
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.
|
||||
|
||||
@@ -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:
|
||||
|
||||
`123 ` (1)
|
||||
|
||||
`"lane ave"` (2)
|
||||
|
||||
`"Columbus"` (3)
|
||||
|
||||
`"OH"` (4)
|
||||
|
||||
`43212` (5)
|
||||
(1) `123 `
|
||||
|
||||
(2) `"lane ave"`
|
||||
|
||||
(3) `**"Columbus"`
|
||||
|
||||
(4) `"OH"`
|
||||
|
||||
(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.
|
||||
|
||||
@@ -64,7 +64,7 @@ Before we can dive into our web project we have to cover some Python basics. Let
|
||||
|
||||
## 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.
|
||||
|
||||

|
||||
|
||||
@@ -99,7 +99,7 @@ Before we can dive into our web project we have to cover some Python basics. Let
|
||||
|
||||

|
||||
|
||||
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
|
||||
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. 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
|
||||
@@ -138,6 +140,6 @@ Before we can dive into our web project we have to cover some Python basics. Let
|
||||
print_goodbye()
|
||||
```
|
||||
|
||||

|
||||
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!
|
||||

|
||||
Reference in New Issue
Block a user