Re: [Tutor] Help with guess my number game

2014-10-13 Thread Alan Gauld
On 13/10/14 11:40, אופיר לירון wrote: # set the initial values the_number = random.randint(1, 100) guess = int(input("Take a guess: ")) tries = 1 # guessing loop while guess != the_number: if guess > the_number: print("Lower...") else: print("Higher...") guess

[Tutor] Fwd: Re: Help with guess my number game

2014-10-13 Thread Danny Yoo
-- Forwarded message -- From: אופיר לירון Date: Mon, Oct 13, 2014 at 1:20 PM Subject: Re: Re: [Tutor] Help with guess my number game To: Danny Yoo Hi Danny Thanks for your response, I think it is part of the problem, but my intention was to end the first loop only after 5 tri

Re: [Tutor] Help with guess my number game

2014-10-13 Thread Danny Yoo
> > if guess != the_number: > > print ("you failed, the number was", the_number) > > elif guess==the_number: > > print("You guessed it! The number was", the_number) > > print("And it only took you", tries, "tries!\n") This block of code appears to be applied for e

[Tutor] Help with guess my number game

2014-10-13 Thread אופיר לירון
Hi,I am new into Python, and using the bookPython Programming for the Absolute Beginner by Michael Dawson.One of the taks in chapte 3 is to change the "guess my number game" to include only 5 gusses and give appropriate messege at the end (in case no sucssesful guess was done).I have tried to add b

Re: [Tutor] Compare two text files

2014-10-13 Thread Steven D'Aprano
On Mon, Oct 13, 2014 at 03:54:59PM +0800, Crusier wrote: > Hi Alan, > > Attached are the two text files (stocklist.txt & stocklist1.txt) which I > want to do a comparison with the content of the file, Basically, I want to > see if there are any new numbers added to the file. > > Please comment on

Re: [Tutor] Compare two text files

2014-10-13 Thread Dave Angel
Crusier Wrote in message: > Attached are the two text files (stocklist.txt & stocklist1.txt) which I want to do a comparison with the content of the file, Basically, I want to see if there are any new numbers added to the file. > Please comment on the sequence of the file: 1. First, Open

[Tutor] Compare two text files

2014-10-13 Thread Crusier
Hi Alan, Attached are the two text files (stocklist.txt & stocklist1.txt) which I want to do a comparison with the content of the file, Basically, I want to see if there are any new numbers added to the file. Please comment on the sequence of the file: 1. First, Open up the File No. 1 and put the

Re: [Tutor] Return Statement error

2014-10-13 Thread William Becerra
I am familiar with funtions, i didn't realize i had to write the return statement inside a function...Thank you all..that was very helpful On 13 Oct 2014 01:03, "Steven D'Aprano" wrote: > On Sun, Oct 12, 2014 at 04:38:54PM +0200, William Becerra wrote: > > Hello, I'm new to programming. I'm usin