This WSQ06 was quite easy, I just had to find a way in which I could get a random number so I used the function random.randint(a,b).

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.Screen Shot 2015-09-10 at 7.55.27 PM

randominteger.py in action:

Screen Shot 2015-09-12 at 4.01.06 PM

This is what happens when you guess the random number.

Screen Shot 2015-09-10 at 7.55.42 PM

This is what happens when you don’t.

CC BY 4.0 WSQ06 by 5nbpppkkyj is licensed under a Creative Commons Attribution 4.0 International License.