Re: [Tutor] infinite loop

2011-11-17 Thread Dave Angel
On 11/17/2011 04:29 PM, ADRIAN KELLY wrote: #i am nearly there guys..please loop at the infinite loop i am getting here..PLEASE!!#ADRIAN def exchange(cash_in):euro=1dollar=float(1.35)base=50if cash_in>base:totalreturn=cash_in*dollarelse:

Re: [Tutor] infinite loop

2011-11-17 Thread Alan Gauld
On 17/11/11 21:29, ADRIAN KELLY wrote: amount=float() You don;t need this line because you assign a value to amount immediately you run main() def main(): amount = float(raw_input('how much do you want to change:')) while amount<50: print 'Sorry, cannot convert an amount under €50 ' To

Re: [Tutor] infinite loop

2011-11-17 Thread Wayne Werner
On Thu, Nov 17, 2011 at 3:29 PM, ADRIAN KELLY wrote: > def main(): > amount = float(raw_input('how much do you want to change:')) > while amount<50: > print 'Sorry, cannot convert an amount under €50 ' > > When do you reassign amount? HTH, Wayne ___

[Tutor] infinite loop

2011-11-17 Thread ADRIAN KELLY
#i am nearly there guys..please loop at the infinite loop i am getting here..PLEASE!!#ADRIAN def exchange(cash_in):euro=1dollar=float(1.35)base=50if cash_in>base:totalreturn=cash_in*dollarelse:totalreturn=0 return totalreturn amoun

Re: [Tutor] Infinite Loop

2011-10-03 Thread Japhy Bartlett
If the guess is larger than the number, your code will never prompt for a new guess in the while loop. Try removing one indent on the input() line. On Sep 24, 2011 10:44 AM, "Cameron Macleod" wrote: Hi, I've been trying to code a simple guess my number game as a starter programming project bu

Re: [Tutor] Infinite Loop

2011-09-24 Thread Alan Gauld
On 24/09/11 15:43, Cameron Macleod wrote: Hi, I've been trying to code a simple guess my number game as a starter programming project but I've generated an infinite loop accidentally. Since I'm new to programming in general, I can't really figure out what's causing it. Nehal told you how to fi

Re: [Tutor] Infinite Loop

2011-09-24 Thread xDog Walker
On Saturday 2011 September 24 07:43, Cameron Macleod wrote: > Hi, > > I've been trying to code a simple guess my number game as a starter > programming project but I've generated an infinite loop accidentally. Since > I'm new to programming in general, I can't really figure out what's causing > it.

Re: [Tutor] Infinite Loop

2011-09-24 Thread nehal dattani
Hi cameron, Sorry, I didn't tested it properly. Actual block should go like this while guess != the_number: if guess > the_number: print("Lower...") else: print("Higher...") guess = int(input("Take a guess: ")) tries += 1 On Sat

Re: [Tutor] Infinite Loop

2011-09-24 Thread nehal dattani
Hi, Please modify your else block . else: print("Higher...") guess = int(input("Take a guess: ")) tries += 1 This should work for you. Regards, Nehal Dattani On Sat, Sep 24, 2011 at 8:13 PM, Cameron Macleod wrote: > Hi, > > I've been trying to code a simple guess my n

[Tutor] Infinite Loop

2011-09-24 Thread Cameron Macleod
Hi, I've been trying to code a simple guess my number game as a starter programming project but I've generated an infinite loop accidentally. Since I'm new to programming in general, I can't really figure out what's causing it. Thanks === import random print("\tWelcome to 'G