To create code we need to think what we are trying to achieve.
A simple program to get our teeth into is a number guessing game. The computer picks a random number and we try to guess it. The computer tells us if we are too high or too low. When we guess it it tells us we have got it correct
So lets come up with a plan
Lets have a deeper look at the if statements.
Lets code it in scratch to see we have the logic right. This can help with the transition from a drag and drop language to a text based one. Also scratch is a bit like sudo code and allows us to test an idea.
Here is the SCRATCH file
Now we understand the problem, lets code it in Python
OK, It works, but can we improve it ?
Here is the Python File