10000 Finish exercises and answers for session_00 · Pcodias/intro-to-python@b5a171b · GitHub
[go: up one dir, main page]

Skip to content

Commit b5a171b

Browse files
committed
Finish exercises and answers for session_00
1 parent 24ff81e commit b5a171b

File tree

5 files changed

+82
-11
lines changed

5 files changed

+82
-11
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,6 @@ This session introduces students to various strategies, tools and models develop
7070

7171
- What is the [Command Line](https://learntocodewith.me/learn/command-line/) and why do we use it?
7272
- What is an [IDE](https://www.redhat.com/en/topics/middleware/what-is-ide)?
73-
- Very interesting [article](https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/) (but quite lengthy) about "What is code?".
73+
- Very interesting [article](https://www.bloomberg.com/graphics/2015-paul-ford-what-is-code/) (although quite lengthy) about "What is code?".
7474
- Basic [programming principles](https://www.hongkiat.com/blog/basic-programming-principals/).
7575
- What is [Kanban](https://kanbanize.com/kanban-resources/getting-started/what-is-kanban)?

best_practices.md

Lines changed: 17 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,28 @@
11
# Best practices for when you are working on exercises
22

3-
### Commenting out shortcut
3+
## Shortcuts
4+
5+
### Commenting out shortcut:
46
- Select the lines you want to comment and press:
57
- Windows: ```Ctrl + / ```
68
- Mac: ```Command + /```
79

10+
11+
### Bash shortcuts
12+
- TAB - autocompletes commands, file names, or directory names for you​.
13+
14+
- UP/DOWN Arrows - Scroll backward and forwards through previous commands you’ve typed in the current session. ​
15+
16+
- F3 - Repeat the previous command​.
17+
18+
- CTRL + C - Abort the current line you’re typing or a command that is currently executing​.
19+
20+
821
---
922

10-
## When you start:
1123

12-
First, make sure you are using the shell (not the console).
24+
## When you start:
25+
First, make sure you are using the shell 🐚 (not the console).
1326

1427
Using the bash shell, navigate the folders using the command-line and make sure you are in the same folder as the files you want to access. Ex: In order to access `exercises_1.py`, you have to be in `intro-to-python/session_01`.
1528

@@ -30,7 +43,7 @@ cd .. # Gets out of the directory you are in
3043
---
3144

3245
## How do you run a python file?
33-
1. Make sure that you are using the shell.
46+
1. Make sure that you are using the Shell 🐚.
3447
1. Verify that you are in the folder containing the file you want to run. You can use `pwd` to check the current folder and `ls` to see the files in the current folder.
3548
2. Run `python <file_name.py>` (ex: `python session_1.py`).
3649

session_00/a.txt

Whitespace-only changes.

session_00/answers_0.md

Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
# Answers from session_00's exercises
2+
3+
## Section A
4+
5+
1. `pwd`.
6+
7+
2. `ls`.
8+
9+
3. `cd session_00`.
10+
11+
4. `mkdir my_first_folder`.
12+
13+
5. `rmdir my_first_folder`.
14+
15+
6. `mkdir animals`.
16+
17+
7. `cd animals`.
18+
19+
8. `touch penguins.txt dogs.txt bees.txt`.
20+
21+
9. `touch snakes.py`.
22+
23+
10. `rm bees.txt`.
24+
25+
11. `echo I love whippets!`.
26+
27+
12. `echo Whippet > dogs.txt`.
28+
29+
13. `date`.
30+
31+
14. `history`.
32+
33+
15. `clear`.
34+
35+
36+
## Section B
37+
1. `cd animals`.
38+
39+
2. `touch my_markdown_recipe.md`.
40+
41+
3. Either type a recipe using [Markdown syntax](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet) or head to [ChatGPT](https://chat.openai.com/) for help.
42+
43+
44+
## Section C
45+
46+
1. `cd ..`.
47+
48+
2. `pwd`.
49+
50+
3. `git add .`.
51+
52+
4. `git commit -m "Finish exercises from session_00."`.
53+
54+
5. `git push origin main`.

session_00/exercises_0.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Before you start, make sure that you are using the Shell 🐚 (not the console).
2525

2626
10. Delete the bees.txt file with the `rm <file_name.txt>` command.
2727

28-
11. Display the text "I love cake" to to the terminal by using `echo <text>`.
28+
11. Display the text "I love whippets!" to to the terminal by using `echo <text>`.
2929

3030
12. Write the line "Whippet" in the dogs.txt file using `echo <text> > <file_name.txt>`.
3131

@@ -39,23 +39,27 @@ Before you start, make sure that you are using the Shell 🐚 (not the console).
3939
# Section B
4040

4141
1. Get out of the `animals` folder using `cd ..` .
42+
4243
2. Create a Markdown file called "my_markdown_recipe" using `touch <file_name.md>`.
43-
3. Inside the "my_markdown_recipe.md" file, type a recipe you like in Markdown format. If you don't have any ideas, and writing up in Markdown seems too much of a chore, just ask [ChatGPT](https://chat.openai.com/) to write one for you (Ex: "Write a burger recipe in markdown format."), and then paste it into your file.
44+
45+
3. Inside the "my_markdown_recipe.md" file, type a recipe you like using the Markdown syntax. If you don't have any ideas, or writing up in Markdown seems too much of a chore, just ask [ChatGPT](https://chat.openai.com/) to write one for you (Ex: "Come up with a recipe in markdown format."), and then paste it into your file.
4446
- When you are done, click on the "open preview" option to see the formatted version.
4547

4648
Great job on getting so far, just one more section to go!
4749

4850
# Section C
4951

5052
1. Get out of the "session_00" folder using `cd ..` .
51-
2. Make sure you are in the "intro_to_python" directory by using the `pwd` command.
52-
3. Use `git status` to see what files and folders have been modified/c
53-
3. Use the `git add .` command to stage all the work you have done.
54-
4. Commit your work with `git commit -m`
5553

54+
2. Make sure you are in the "intro-to-python" directory by using the `pwd` command.
55+
56+
3. Use the `git add .` command to stage all the work you have done.
5657

58+
4. Commit your work with `git commit -m "<Short description of what you have worked on.>"`.
5759

60+
5. Push your work to GitHub with `git push origin main`.
5861

62+
Congratulations, all your work is now updated and stored on [GitHub](https://github.com/).
5963

6064

6165
---

0 commit comments

Comments
 (0)
0