Re: [Tutor] Query regarding loop problem

2015-08-31 Thread Laura Creighton
I have been told that in gmail it is simple, but far from obvious to get your mail to open so you add to the bottom. There are three tiny dots which conceal the previous text. Click on that, and then add below. I am also told that if you open your mail message with 'control A' (hold the contro

Re: [Tutor] Query regarding loop problem

2015-08-30 Thread Laura Creighton
Alan has pointed out the string/int problem with your code. Your code has a different problem, as well. ># User enters a number between 1 - 5 ># Computer generates random number until an equivalent number is achieved > >import random >computerNumber = 0 Ok, now you have set computerNumber to 0

Re: [Tutor] Query regarding loop problem

2015-08-29 Thread Cameron Simpson
On 29Aug2015 22:37, Martin Mwaka wrote: I would be grateful for some help please. I have recently started learning python and I am attemping to write a programme where a user enters a number between 1 and 5, and the computer generates random numbers until an equivalent number is achieved. The

Re: [Tutor] Query regarding loop problem

2015-08-29 Thread Alan Gauld
On 29/08/15 22:37, Martin Mwaka wrote: myNumber = input("Input a number between 1 and 5: ") myNumber is now a *string* representing a number from 1-5. while computerNumber != 0: if myNumber != computerNumber: computerNumber = random.randint(1,5) computerNumber is now a random