On 26/06/13 23:07, Danilo Chilene wrote:
Hello,
Try something like this:
coin = raw_input('Insert coins:\n')
while(coin > 0):
coin = int(coin)-1
print 'You have {0} coin(s)'.format(coin)
Note you did not convert the original raw_input value to an int.
Also you keep on converting co
Hello,
Try something like this:
coin = raw_input('Insert coins:\n')
while(coin > 0):
coin = int(coin)-1
print 'You have {0} coin(s)'.format(coin)
$ python teste.py
Insert coins:
2
You have 1 coin(s)
You have 0 coin(s)
On Wed, Jun 26, 2013 at 3:30 PM, Chris “Kwpolska” Warrick <
kwpol.
On Wed, Jun 26, 2013 at 11:23 AM, Jack Little wrote:
> In a combat system, how would I have a certain raw_input repeat until the
> enemy is dead?
>
Sounds like a classic case for a "while" loop.
___
Tutor maillist - Tutor@python.org
To unsubscribe or c
In a combat system, how would I have a certain raw_input repeat until the enemy
is dead?
Thanks a ton,
Jack___
Tutor maillist - Tutor@python.org
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor