Goals for Today
- To make maintaining the GitHub site more efficient.
- To do more list comprehension lessons.
- Finish the day 2 challenge!
- Do some other challenges
What I Learned
Maintaining This Site
Maintaining this site was too time-consuming, with too much duplication of words and concepts, so I’m in the process of simplifying it. Namely, I’m reducing the sections on these pages from:
- My Approach
- Solution, and
- What I Learned.
- Goal(s), and
- What I Learned.
You’ll notice Goal changed to Goal(s) because I often want to cover more than one topic in a day.
In addition, I’m greatly simplifying what I put on the main README.md file and just pointing the reader to the daily pages instead. The main page will have a very concise summary only.
I got sidetracked by the Hackerrank challenges. Perhaps I’ll come back to this if the need arises.
Day 2 Challenge
The challenge website (subscription needed) listed these resources to help with the two bonuses.
- How to loop with indexes in Python
- Multiple assignment and tuple unpacking improve Python code readability – Trey Hunner
- Python List Comprehensions: Explained Visually – Trey Hunner
- Asterisks in Python: what they are and how to use them – Trey Hunner
- What does ** (double star/asterisk) and * (star/asterisk) do for parameters?
- Manually raising (throwing) an exception in Python
The last one proved beneficial to review how to throw exceptions.
I wrote a test program to develop a function to test for inconsistencies in matrix lengths. See test-sublist-lengths.py.
I think I’ve got the program working to where I want it to. I’m having trouble with Bonus 2 because I’m not understanding how to use the test file they provided. I could ask about it in a forum I’m sure but I just want to get on with some other challenges.
For some other challenges, I’ve decided to use Hackerrank as it’s a site I’ve used in the past and have been impressed with the quality of the challenges and the interface.
Just for fun, I decided to start right at the beginning of their Python challenges which starts at Hello World but then ramps up fairly quickly. For me, it’s an excellent review.
So far I’ve completed all the Introduction section and three of the Basic Data Types challenges. (See this folder)
If you’re wondering what the filename.py file is, it’s a quick utility I wrote for generating filenames for the challenges and the screenshots I’m saving. You’ll note that it uses f-strings, which I’m a big fan of.