I had a bit of a setback between the last diary entry and this one. But I will be picking up all the things I was going to do then today.
I started off today by working on Python. I began by revising if statements using conditions and Boolean's. I made a rock, paper, scissors style game without the computer having random inputs since I have not learnt how to achieve this yet, as well as a key and password 2FA style Boolean if statement.
Following this, the next topics of the tutorial covered 3 different projects that utilise if statements with different functions. The first project was a calculator that asks for 2 numbers and an operator to calculate the 2 numbers together. Here is what it looks like.
The next project was a weight converter from KG to Lbs and vice versa. This was a simple converter using both multiply and divide and also learning how to reassign a variable within the if statement to change the name of the unit variable.
Finally the last project was the create a temperature converter to calculate Fahrenheit and Celsius in the opposite unit of measurement to convert it. Below is the if statement and user input required to recreate this.




No comments:
Post a Comment