I’m sure my code can be optimized but I tried to write it as clean i.e. readable, as possible. So yeah, all I did was print some options for the user and ask for two numbers to work with. Finally, I created some functions so they are called according to the user’s needs.
This is ontofunctions.py in action!
]]>This is my code:
This is Sumofnumbers.py in action:
]]>What my program does
It sets a random number between 1 and 100 and then asks the user to guess that number. I wrote it in a way that the user has 5 chances to get it right. I did this by setting a variable which counts how many times they get it wrong and each time it tells them if their guess its low or high. If they get it right, the program tells them the number of attempts it took them to guess.
randominteger.py in action:
]]>In this WSQ I ask the user to choose a temperature measurement unit to convert their Fahrenheit degrees to.
Once they chose it I inserted their integer input into its respective formula.
I printed the conversion result and used if and elif to state whether their water is boiling or not.
WSQ05.py in action.
]]>