[Tutor] arrays, while loops

Ricardo Araoz ricaraoz at gmail.com
Tue Feb 21 00:17:20 CET 2012


El 20/02/12 13:42, Dave Angel escribió:
> I'm not sure who you are, but you forgot to include the list. 
> Therefore I'll forward this to the list, and add my comments about
> your suggestions.
>
> On 02/20/2012 11:31 AM, Ricardo Araoz wrote:
>> Untested :
>> while True:
>>      try:
>>          amounts[index] = int (input ("Enter an amount: "))
>>          amtinput = int (amounts)
>
> int() won't operate on a list.  Probably you meant it to operate on a
> string, but there are no strings in it, it's a list of ints.
>
>

sorry I meant :

amtinput = int (input ("Enter an amount: "))
amounts[index] = amtinput






More information about the Tutor mailing list