Hello, everyone! I decided to start my 100 Days Of Python series as a way of logging my progress on relearning the basics of Python. The last time I’ve worked on Python was when I was in college. Since I’m interested in automation as well as improving on my game apps, I figured it’ll be a great way to strengthen my programming skill. My hope is that by the time I finish the challenge, I’ll be able to have a better understanding of the language.
Without further ado, here’s my progress on the first five days of the challenge.
Getting into the basics such as variables and combining string texts were a breeze. I did learn about utilizing f-strings when adding variables in your printed statements. Created a fun band generator that simply joins the two inputs into one statement.
The tip calculator project was a fun way of utilizing mathematical expressions, especially when calculating percentages and remainders. Not to mention, working with floats and how to round off numbers. This project asks for three inputs: the total amount of the bill, how many people to split the bill, and the tip percentage you want to give.
Learned about if-else statements and how they can be nested when making choices, depending on the user’s input. I have to admit, the indentation of the nested statements made me confused at first. What helped was creating a diagram that determines the logic flow of how the if-else statements are conducted. I had fun making the Cow Island game as it reminded me of my visual novel game development where you had to pick and choose your own adventure.
Learned about using the
random() module, creating arrays, and how to utilize them for the rock, paper, and scissors project. It involved using nested statements, some ASCII art, and making the computer provide a random choice to indicate if you win or lose the game. One thing I could’ve improved on the project was adding a statement that lets the users know that if they inputted an incorrect number or provided a letter, they would receive an error from the program.
So far, I think Day 5’s project in creating a password generator was a proud moment of mine. This project utilizes for loops, along with lists and the random() module. The option to make it easy was on the table in terms of simply joining the inputs into one. For example, the easy way would’ve had the output “abc!%$123”. However, I wanted to take it one step notch by using the
random.shuffle() function to shuffle the contents from the list and therefore, output the password in an entirely different order. Some of the letters, symbols, and numbers may be duplicated in the end result, but that’s due to the
random.choice() function when it was passed through the for loops.
I anticipate my next article will cover Days 6 through 10 in about a week or so, assuming that life events or anything strange won't get in the way 😂 If you happen to like this article, feel free to share and tweet at me on your thoughts.