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:
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
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
___
#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
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
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
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.
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
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
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
10 matches
Mail list logo