[email protected] wrote on 10/20/2010 07:30:32 PM:
>
> thing = raw_input("What is the first number?\n\n")
>
> thing2 = raw_input("What is the second number?\n\n")
>
> int(thing)
> int(thing2)
>
The two lines above do the calculation of turning your input
strings into int's but do not save the value anywhere.
You want to assign the calculation to a variable (can reuse thing
and thing2 if you wish) and then use that calculation later on.
<Snip>
>
> The only problem is that when I tell it that thing3 = x/thing it gives
> an error. Here it is:
>
> Traceback (most recent call last):
> File "C:/Documents and Settings/Family/My Documents/LCM.py", line 10,
> in <module>
> thing3 = x/thing
> TypeError: unsupported operand type(s) for /: 'int' and 'str'
the error here is telling you that thing is a string and python cannot
divide an int by a string.
>
> Same with thing4...
>
> Can you please help! Thanks in advance...
I didn't check the rest of the program. But that should at least get you
moving along.
Chris
_______________________________________________
Tutor maillist - [email protected]
To unsubscribe or change subscription options:
http://mail.python.org/mailman/listinfo/tutor