8000 finish exercises_0 · zfoxpython/intro-to-python@24ff81e · GitHub
[go: up one dir, main page]

Skip to content
8000

Commit 24ff81e

Browse files
committed
finish exercises_0
1 parent e9379f1 commit 24ff81e

File tree

3 files changed

+76
-31
lines changed

3 files changed

+76
-31
lines changed
File renamed without changes.

session_00/exercises_0.md

Lines changed: 72 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,75 @@
11
# Session 0 Exercises
22

3-
## Refresher
3+
## Section A
4+
5+
Before you start, make sure that you are using the Shell 🐚 (not the console).
6+
7+
1. Use `pwd` to check in what directory you are.
8+
9+
2. Use `ls` to check what files and folders are in the current directory.
10+
11+
3. Using `cd <directory_name>` go into the "session_00" directory.
12+
13+
4. Create a new folder named "my_first_folder" using `mkdir <directory_name>`.
14+
15+
5. Delete the empty folder "my_first_folder" using `rmdir <directory_name>`.
16+
17+
6. Create a new folder named "animals" using `mkdir <directory_name>`.
18+
19+
7. Get into the animals folder by using `cd <directory_name>`.
20+
21+
8. Create 3 text files named "penguins.txt", "dogs.txt", "bees.txt" by using `touch <file_name.txt>`.
22+
- Extra challenge: Can you do this while using `touch` only once?
23+
24+
9. Create your first python file called "snakes.py" by using `touch <file_name.py>`.
25+
26+
10. Delete the bees.txt file with the `rm <file_name.txt>` command.
27+
28+
11. Display the text "I love cake" to to the terminal by using `echo <text>`.
29+
30+
12. Write the line "Whippet" in the dogs.txt file using `echo <text> > <file_name.txt>`.
31+
32+
13. Display the date in the terminal using the `date` command.
33+
34+
14. Display the recent history of your bash commands using the `history` command.
35+
36+
15. Clear your terminal with the `clear` command.
37+
38+
39+
# Section B
40+
41+
1. Get out of the `animals` folder using `cd ..` .
42+
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+
- When you are done, click on the "open preview" option to see the formatted version.
45+
46+
Great job on getting so far, just one more section to go!
47+
48+
# Section C
49+
50+
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`
55+
56+
57+
58+
59+
460

561
---
662

63+
64+
## Cheat sheets
65+
- Command Line [cheat sheet](https://www.git-tower.com/blog/command-line-cheat-sheet/)
66+
- Git commands [cheat sheet](https://education.github.com/git-cheat-sheet-education.pdf)
67+
- Markdown [cheat sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
68+
69+
---
70+
71+
## Refresher
72+
773
### Bash commands:
874

975
```bash
@@ -31,15 +97,17 @@ rm <file_name.txt/file_name.py> # Deletes file
3197

3298

3399

34-
echo "Hello!" # Print the text "Hello!" in the terminal window​
100+
echo <text> # Displays in the terminal a line of text, Ex: echo Hello!
35101

36-
echo "Bonjour!" > file.txt # Writes the text "Bonjour!" in the file.txt file​
102+
echo <text> > <file_name.txt> # Writes a line of text in a file, Ex: echo Bonjour! > file.txt
37103

38-
cat file.txt # Reads the file.txt file -> prints the text "Bonjour!" to the console​
104+
cat <file_name.txt> # Reads the file and displays it line by line in the terminal, Ex: cat file.txt --> Bonjour!
39105

40106

41107
history # Displays your recently run Bash Commands​
42108

109+
date # Displays the date
110+
43111
clear # Clears the terminal screen
44112

45113
```
@@ -67,29 +135,6 @@ git push origin main # Uploads local changes to your remote repository, on the m
67135

68136
---
69137

70-
## Section A
71-
72-
1. Use `pwd` to check in what directory you are.
73-
74-
2. Use `ls` to check what files and folders are in the current directory.
75-
76-
3. Using `cd <directory_name>` go into the `session_00` directory.
77-
78-
4. Create a new folder named `my_first_folder` using `mkdir <directory_name>`.
79-
80-
5. Delete the empty folder `my_first_folder` using `rmdir <directory_name>`.
81-
82-
6. Create a new folder named `animals` using `mkdir <directory_name>`.
83-
84-
7. Get into the `animals` folder by using `cd <directory_name>`.
85-
86-
8. Create 3 text files named `penguin.txt`, `dog.txt`, `bee.txt` by using `touch <file_name.txt>`.
87-
- Extra challenge: Can you do this while using `touch` only once?
88-
89-
9. Create your first python file called `snake.py` by using `touch <file_name.py>`.
90-
91-
10. Delete the `bee.txt` file with the `rm <file_name.txt>` command.
92138

93-
11.
94139

95140

session_00/slides_0.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,16 +113,16 @@ cp original_filename copy_filename # Makes a copy of a file
113113
# More bash commands
114114

115115
```bash
116-
echo "Hello!" # Print the text "Hello!" in the terminal window​
116+
echo <text> # Displays in the terminal a line of text, Ex: echo Hello!
117117

118-
echo "Bonjour!" > file.txt # Writes the text "Bonjour!" in the file.txt file​
118+
echo <text> > <file_name.txt> # Writes a line of text in a file, Ex: echo Bonjour! > file.txt
119119

120-
cat file.txt # Reads the file.txt file -> prints the text "Bonjour!" to the console​
120+
cat <file_name.txt> # Reads the file and displays it line by line in the terminal, Ex: cat file.txt --> Bonjour!
121121

122122

123123
history # Displays your recently run Bash Commands​
124124

125-
wget <https://somewhere.com/afile.zip> # Downloads file/files from the link
125+
date # Displays the date
126126

127127
man <command> # Displays the manual and description for the chosen command -> ex: man ls/pwd/cd/mkdir
128128

0 commit comments

Comments
 (0)
0