8000 Refactor slides_0 and exercises. · zfoxpython/intro-to-python@b21b5a1 · GitHub
[go: up one dir, main page]

Skip to content

Commit b21b5a1

Browse files
committed
Refactor slides_0 and exercises.
1 parent cf5e28b commit b21b5a1

File tree

7 files changed

+93
-42
lines changed

7 files changed

+93
-42
lines changed

best_practices.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222

2323

2424
## When you start:
25-
First, make sure you are using the shell 🐚 (not the console).
25+
First, make sure you are using the Shell 🐚 (not the console).
2626

27-
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`.
27+
While 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`.
2828

2929
Here are some CLI commands to help you out:
3030

session_00/answers_0.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616

1717
7. `cd animals`.
1818

19-
8. `touch penguins.txt dogs.txt bees.txt`.
19+
8. `touch penguins.txt dogs.txt roses.txt`.
2020

2121
9. `touch snakes.py`.
2222

23-
10. `rm bees.txt`.
23+
10. `rm roses.txt`.
2424

2525
11. `echo I love whippets!`.
2626

session_00/exercises_0.md

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -18,12 +18,12 @@ Before you start, make sure that you are using the Shell 🐚 (not the console).
1818

1919
7. Get into the animals folder by using `cd <directory_name>`.
2020

21-
8. Create 3 text files named "penguins.txt", "dogs.txt", "bees.txt" by using `touch <file_name.txt>`.
21+
8. Create 3 text files named "penguins.txt", "dogs.txt", "roses.txt" by using `touch <file_name.txt>`.
2222
- Extra challenge: Can you do this while using `touch` only once?
2323

2424
9. Create your first python file called "snakes.py" by using `touch <file_name.py>`.
2525

26-
10. Delete the bees.txt file with the `rm <file_name.txt>` command.
26+
10. Delete the roses.txt file with the `rm <file_name.txt>` command.
2727

2828
11. Display the text "I love whippets!" to to the terminal by using `echo <text>`.
2929

@@ -66,33 +66,33 @@ Congratulations, all your work is now updated and stored on [GitHub](https://git
6666

6767
---
6868

69+
# Cheat sheets
6970

70-
## Cheat sheets
7171
- Command Line [cheat sheet](https://www.git-tower.com/blog/command-line-cheat-sheet/)
7272
- Git commands [cheat sheet](https://education.github.com/git-cheat-sheet-education.pdf)
7373
- Markdown [cheat sheet](https://github.com/adam-p/markdown-here/wiki/Markdown-Cheatsheet)
7474

7575
---
7676

77-
## Refresher
77+
# Refresher
7878

79-
### Bash commands:
79+
## Bash commands:
8080

8181
```bash
82-
pwd # Prints to the console the path of your current working directory
82+
pwd # Prints to the console the path of your current working directory
83+
# (short for "Print Working Directory")
8384

84-
ls # Lists the files in the directory you are in
85+
ls # Lists the files in the current directory (short for "LiSt")
8586

87+
cd <directory_name> # Gets in a given directory (short for "Change current working Directory")
8688

87-
cd <directory_name> # Gets in a given directory
89+
cd .. # Gets out of the current directory
8890

89-
cd .. # Gets out of the directory you are in
9091

9192

93+
mkdir <directory_name> # Creates new directory (short for "MaKe DIRectory")
9294

93-
mkdir <directory_name> # Creates new directory
94-
95-
rmdir <directory_name> # Deletes an empty Directory (Folder)
95+
rmdir <directory_name> # Deletes an empty Directory (short for "ReMove DIRectory")
9696

9797
rm -r <directory_name> # Deletes the directory and its contents recursively
9898

@@ -103,11 +103,14 @@ rm <file_name.txt/file_name.py> # Deletes file
103103

104104

105105

106-
echo <text> # Displays in the terminal a line of text, Ex: echo Hello!
106+
echo <text> # Displays in the terminal a line of text, Ex: echo Hello! --> Hello!
107107

108108
echo <text> > <file_name.txt> # Writes a line of text in a file, Ex: echo Bonjour! > file.txt
109-
110-
cat <file_name.txt> # Reads the file and displays it line by line in the terminal, Ex: cat file.txt --> Bonjour!
109+
# The > overwrites the file if it exists or creates it if it doesn't exist.
110+
# The >> appends to a file or creates the file if it doesn't exist.
111+
112+
cat <file_name.txt> # Reads the file and displays it line by line in the terminal,
113+
# (short for "conCATenates files"). Ex: cat file.txt --> Bonjour!
111114

112115

113116
history # Displays your recently run Bash Commands​
@@ -120,15 +123,15 @@ clear # Clears the terminal screen
120123

121124
---
122125

123-
### Bash shortcuts:
126+
## Bash shortcuts:
124127

125128
- TAB - autocompletes commands, file names, or directory names for you​.
126129

127130
- UP/DOWN Arrows - Scroll backward and forwards through previous commands you’ve typed in the current session. ​
128131

129132
---
130133

131-
### Git commands:
134+
## Git commands:
132135

133136
```shell
134137

session_00/slides_0.md

Lines changed: 60 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -92,14 +92,15 @@
9292
# Bash commands
9393

9494
```bash
95-
pwd # Prints to the console the path of your current working directory
95+
pwd # Prints to the console the path of your current working directory
96+
# (short for "Print Working Directory")
9697

97-
ls # Lists the files in the directory you are in
98+
ls # Lists the files in the current directory (short for "LiSt")
9899

99100

100-
cd <directory_name> # Gets in a given directory
101+
cd <directory_name> # Gets in a given directory (short for "Change current working Directory")
101102

102-
cd .. # Gets out of the directory you are in
103+
cd .. # Gets out of the current directory
103104

104105
```
105106

@@ -108,11 +109,12 @@ cd .. # Gets out of the directory you are in
108109
# More bash commands
109110

110111
```bash
111-
mkdir <directory_name> # Creates new directory
112+
mkdir <directory_name> # Creates new directory (short for "MaKe DIRectory")
112113

113-
rmdir <directory_name> # Deletes an empty Directory (Folder)
114+
rmdir <directory_name> # Deletes an empty Directory (short for "ReMove DIRectory")
114115

115116
rm -r <directory_name> # Deletes the directory and its contents recursively
117+
# the "-" is called a "flag parameter" and it modifies the behaviour of the command
116118

117119

118120
touch <file_name.txt/file_name.py> # Creates new file
@@ -131,11 +133,14 @@ cp original_filename copy_filename # Makes a copy of a file
131133
# More bash commands
132134

133135
```bash
134-
echo <text> # Displays in the terminal a line of text, Ex: echo Hello!
136+
echo <text> # Displays in the terminal a line of text, Ex: echo Hello! --> Hello!
135137

136138
echo <text> > <file_name.txt> # Writes a line of text in a file, Ex: echo Bonjour! > file.txt
137-
138-
cat <file_name.txt> # Reads the file and displays it line by line in the terminal, Ex: cat file.txt --> Bonjour!
139+
# The > overwrites the file if it exists or creates it if it doesn't exist.
140+
# The >> appends to a file or creates the file if it doesn't exist.
141+
142+
cat <file_name.txt> # Reads the file and displays it line by line in the terminal,
143+
# (short for "conCATenates files"). Ex: cat file.txt --> Bonjour!
139144

140145

141146
history # Displays your recently run Bash Commands​
@@ -166,13 +171,48 @@ clear # Clears the terminal screen
166171

167172
---
168173

169-
# Coding Time
174+
175+
# Coding Time
170176
## Section A
171177

178+
179+
---
180+
181+
182+
# Steps
183+
184+
### On Github
185+
186+
1. Fork the intro-to-python repo → https://github.com/sergiuHudrea/intro-to-python
187+
188+
### On Replit
189+
190+
1. Click on "Create Repl".
191+
2. Select "Import from GitHub"
192+
3. Paste link of your newly forked repo into the "GitHub URL" section.
193+
4. Click on "Import from GitHub".
194+
4. Check that you have access to the Shell.
195+
5. Start Section A from exercises_0.md. Make sure you click on "Open preview", so you can see nicely formatted.
196+
197+
198+
---
199+
200+
# Versioning problem
201+
202+
### Did you ever find yourself in this situation while working on an essay or document?
203+
- essay, essay2, essay2.5, essay_final, essay_FINAL, essay_FINAL2, ESSAY_REALLY_LAST_ONE
204+
205+
206+
---
207+
208+
209+
# So what is the solution?
210+
172211
---
173212

174213
# Source Control Management(SCM) and Git
175214

215+
176216
---
177217

178218

@@ -205,7 +245,7 @@ clear # Clears the terminal screen
205245

206246
# Git - What does it do?
207247

208-
- Allows you to **collaborate** on a project w**ithout interfering with each other’s work.​**
248+
- Allows you to **collaborate** on a project **without interfering with each other’s work.​**
209249

210250
- Keeps a **historical record of everyone's work** so you can go back to previous records.​
211251

@@ -219,12 +259,12 @@ clear # Clears the terminal screen
219259

220260
### Remote Repository​
221261

222-
- This is where everyone shares their code centrally (ex: GitHub). ​
262+
- This is where everyone shares their code centrally (ex: GitHub) -> Think OneDrive, but for source code.
223263

224264

225265
### Local Repository​
226266

227-
- When you commit your code, a local version is created on your machine.
267+
- A local version of the source code which resides on your machine. -> Think making a local copy of a file from OneDrive to your computer.
228268

229269
---
230270

@@ -274,6 +314,8 @@ git pull origin main # Downloads changes from the remote repository (main branch
274314

275315
- ***Markdown* is a lightweight markup language for creating formatted text using a plain-text editor.**
276316

317+
- **Fun fact:** This presentation was actually made by converting a markdown file into slides.
318+
277319
---
278320

279321
# IDEs
@@ -286,5 +328,9 @@ git pull origin main # Downloads changes from the remote repository (main branch
286328

287329
- **You can develop applications without an IDE**, but the you would have to build your own IDE by manually integrating the tools you need.​
288330

289-
- **Replit** = a **cloud IDE** --> No need for downloading software and configuring local environments. No more "But it works on my machine".
331+
- **Replit** = a **cloud IDE** -> No need for downloading software and configuring local environments. No more "But it works on my machine".
290332

333+
---
334+
335+
# Coding Time
336+
## Section B

session_01/exercises_1.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,14 @@
11
# Session 1 Exercises
22

33
# Please have a look at the best_practices.md file beforehand.
4+
# Don't forget to comment out any piece of code that you dont want to be executed when running the file.
5+
6+
# Commenting out shortcut:
7+
# Select the lines you want to comment and press:
8+
# - Windows: ```Ctrl + / ```
9+
# - Mac: ```Command + /```
10+
411

5-
612
## Section A
713
# 1. Write code that prints ‘Hello world’.
814

session_09/project_info.md

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
# Command-line project
22

3-
Please copy the kanban board from [here](https://github.com/users/sergiuHudrea/projects/5) and follow the instructions. **Make sure you tick** the "Draft issues will be copied if selected" box.
3+
Please copy the kanban board from [here](https://github.com/users/sergiuHudrea/projects/5) and follow the **"Set up your project"** ticket from the Todo column. **Make sure you tick** the **"Draft issues will be copied if selected" box**.
44

55
**DEADLINE for project submission:** one month from the last session.
66

7-
Once done, send your project (the GitHub link of it) to UK-DLKPMGPYTHONLEADERSHIP@KPMG.co.uk.
7+
Once done, send your project (the GitHub link of your repo) to UK-DLKPMGPYTHONLEADERSHIP@KPMG.co.uk.
88

99
## Project requirements
1010

@@ -18,10 +18,6 @@ The project should:
1818
8. Contain a README.md file with the description of your project.
1919

2020

21-
22-
23-
24-
2521
---
2622

2723
## Resources
File renamed without changes.

0 commit comments

Comments
 (0)
0