Skip to content

Commit af4264f

Browse files
committed
Merge remote-tracking branch 'upstream/master'
2 parents 6dea2c9 + 4762b31 commit af4264f

File tree

62 files changed

+2845
-1850
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

62 files changed

+2845
-1850
lines changed

.gitignore

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,3 +105,11 @@ ENV/
105105
days/91-93-sqlalchemy/demo/persistent_rps/db/rock_paper_scissors.sqlite
106106
days/91-93-sqlalchemy/demo/persistent_rps_starter/.vscode/settings.json
107107
rock_paper_scissors.sqlite
108+
109+
# Gimp
110+
*.xcf
111+
112+
# TexturePacker
113+
*.tps
114+
115+
**.DS_Store

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# #100DaysOfCode with Python course
2+
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/talkpython/100daysofcode-with-python-course.git/master)
3+
24

35
[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/pathcl/100daysofcode-with-python-course.git/master)
46

days/01-03-datetimes/README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Work on *Bite 7 - Parsing dates from logs* for your second day of learning datet
2222

2323
Edit: We decided to simplify Bite 7 slightly after some feedback we received from students. We've now removed the requirement to read in the file which should keep the Bite focused on the theme.
2424

25-
Additionally, we've added another Bite that should be more appropriate for beginners. Unlock it here: [https://codechalleng.es/bites/promo/datetimes_starter](https://codechalleng.es/bites/promo/datetimes_starter)
25+
Additionally, we've added another TWO free Bites that should be more appropriate for beginners. Unlock them here: [https://codechalleng.es/bites/promo/datetimes_starter](https://codechalleng.es/bites/promo/datetimes_starter) and [https://codechalleng.es/bites/promo/more-datetimes](https://codechalleng.es/bites/promo/more-datetimes).
2626

2727

2828
## Day N+2: Your Turn!
@@ -33,11 +33,12 @@ A fun project would be to create yourself a Pomodoro Timer that incorporates dat
3333

3434
This could also be applied to a stopwatch app. Use time of course but also throw in the timestamps and even some basic calculations on the difference between the start and end timestamps.
3535

36+
We encourage you to _pull request_ your work via [PyBites Code Challenge #52](https://codechalleng.es/challenges/52/). Have fun!
3637

3738
### Time to share what you've accomplished!
3839

3940
Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag **#100DaysOfCode**.
4041

4142
Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.
4243

43-
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).*
44+
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).*

days/04-06-collections/README.md

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
# Collections module
2+
3+
## Day 1: Your new data structure friends
4+
5+
Welcome to this lesson. Today you will learn about some powerful new data structures: `namedtuple`, `defaultdict`, `Counter` and `deque`.
6+
7+
Today you watch the videos. I also prepared a [Jupyter notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/04-06-collections/collections.ipynb) so you can follow along with this lesson.
8+
9+
## Day 2: Practice using movie data
10+
11+
You get to use these new data structures I encourage you to code an exercise: [PyBites Code Challenge 13 - Highest Rated Movie Director](https://pybit.es/codechallenge13.html).
12+
13+
See the [notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/04-06-collections/collections.ipynb) for more info how to complete this exercise.
14+
15+
You can also take a slimmed down version of this exercise [on our platform](https://codechalleng.es/bites/30/).
16+
17+
## Day 3: More practice on your own data
18+
19+
We challenge you to find your own data set and try to use the new collections data structures yourself.
20+
21+
Stuck at finding examples? We used `collections` quite a bit for [when we did the 100 Days of Code](https://github.com/pybites/100DaysOfCode/blob/master/LOG.md):
22+
23+
$ python module_index.py |grep collections
24+
collections | stdlib | 001, 021, 023, 034, 036, 042, 045, 055, 057, 063, 076, 084, 086, 095, 096
25+
26+
## Time to share what you've accomplished!
27+
28+
Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag **#100DaysOfCode**.
29+
30+
Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.
31+
32+
See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).

days/10-12-pytest/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ Be warned: mastering `pytest` might feel like possessing a super power!
1414

1515
## Day N: Setup + Learn pytest
1616

17-
Today you will pip install `pytest` and `pytest-cov` and watch the video lectures.
17+
Today you will pip install `pytest` and `pytest-cov` (best practice is to use a [virtual environment](https://pybit.es/the-beauty-of-virtualenv.html)) and watch the video lectures.
1818

1919
Start thinking about how you can write tests for your code ...
2020

days/13-15-text-games/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ def game_loop(player1, player2, rolls):
7474
# Compute who won
7575
```
7676

77-
Bonus points for address the possibility of a tie after three rounds.
77+
Bonus points if you address the possibility of a tie after three rounds.
7878

7979
## Day 15: Tidy up standard **Rock, Paper, Scissors**
8080

@@ -116,4 +116,4 @@ Be sure to share your last couple of days work on Twitter or Facebook. Use the h
116116

117117
Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.
118118

119-
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).*
119+
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).*

days/13-15-text-games/data/sample_reader.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@ def read_roll(row: dict):
1515
print("Roll: {}".format(name))
1616
for k in row.keys():
1717
can_defeat = row[k].strip().lower() == 'win'
18-
print(" * {} will default {}? {}".format(name, k, can_defeat))
18+
print(" * {} will defeat {}? {}".format(name, k, can_defeat))
1919

2020
print()
2121

22-
read_rolls()
22+
read_rolls()

days/13-15-text-games/rps15.jpg

-2.4 KB
Loading
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
# List comprehensions and generators
2+
3+
## Day 1: Ready to learn some powerful, Pythonic concepts?
4+
5+
> List comprehensions and generators are in my top 5 favorite Python features leading to clean, robust and Pythonic code.
6+
7+
Welcome to this lesson. In today's videos you will learn two powerful techniques you can use in Python: list comprehensions and generators.
8+
9+
I prepared a [Jupyter notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/16-18-listcomprehensions-generators/list-comprehensions-generators.ipynb) so you can follow along with this lesson.
10+
11+
## Day 2: Practice!
12+
13+
Look at your code and see if you can refactor it to use list comprehensions. Same for generators. Are you building up a list somewhere where you could potentially use a generator?
14+
15+
[My notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/16-18-listcomprehensions-generators/list-comprehensions-generators.ipynb) has an exercise to sink your teeth in. Please try it and tomorrow I will discuss the solution.
16+
17+
## Day 3: Solution / simulate unix pipelines
18+
19+
I will detail the solution of yesterday's exercise [in my notebook](https://github.com/talkpython/100daysofcode-with-python-course/blob/master/days/16-18-listcomprehensions-generators/list-comprehensions-generators.ipynb)
20+
21+
Today if you have time left, I encourage you to try 2 extra exercises [on our platform](https://codechalleng.es):
22+
- [Bite 5. Parse a list of names](https://codechalleng.es/bites/5/) (use a set comprehension in first function)
23+
- [Bite 26. Dictionary comprehensions are awesome](https://codechalleng.es/bites/promo/awesome-dict-comprehensions)
24+
25+
If you still have time left, or you prefer to practice generators check out this cool blog code challenge: [Code Challenge 11 - Generators for Fun and Profit](https://codechalleng.es/challenges/11/)
26+
27+
## Time to share what you've accomplished!
28+
29+
Be sure to share your last couple of days work on Twitter or Facebook. Use the hashtag **#100DaysOfCode**.
30+
31+
Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.
32+
33+
See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).

days/19-21-itertools/README.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,10 @@ After watching the first 4 videos pop into your Python shell and start playing a
1616

1717
Yep that's right! For your second day, use itertools to create a script that simulates traffic lights!
1818

19+
The idea is to perhaps... *cycle* (hint hint!) through the different colours of a set of traffic lights - red, amber and green - printing the name of the colour every time the cycle occurs.
20+
21+
For bonus points: traffic lights normally cycle between green and red based on traffic levels so you never know exactly when the change will happen. This is a great chance to throw some randomness into your script.
22+
1923
If you get absolutely stuck, watch the *Traffic Lights* video to see how we did it.
2024

2125

@@ -40,4 +44,4 @@ Be sure to share your last couple of days work on Twitter or Facebook. Use the h
4044

4145
Here are [some examples](https://twitter.com/search?q=%23100DaysOfCode) to inspire you. Consider including [@talkpython](https://twitter.com/talkpython) and [@pybites](https://twitter.com/pybites) in your tweets.
4246

43-
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).*
47+
*See a mistake in these instructions? Please [submit a new issue](https://github.com/talkpython/100daysofcode-with-python-course/issues) or fix it and [submit a PR](https://github.com/talkpython/100daysofcode-with-python-course/pulls).*

0 commit comments

Comments
 (0)