Newbie question. Are those different objects ?

rusi rustompmody at gmail.com
Fri Dec 20 10:34:20 EST 2013


On Friday, December 20, 2013 8:46:31 PM UTC+5:30, dec... at msn.com wrote:
> y = raw_input('Enter a number:')
> print type y
> y = float(raw_input('Enter a number:'))
> print type y

> I'm assuming that y is an object. I'm also assuming that the second and the first y are different objects because they have different types.

You are also assuming that the two horizontal lines sometimes called 'equals'
have something to do with something called by the same name in math -- equations

Lets unassume that and rewrite the code

1. y ! raw_input('Enter a number:')
2. print type y
3. y ! float(raw_input('Enter a number:'))
4. print type y 

Now read that 1 as first, 2 as second etc and read the '!' as 'MAKE'.
(It may help to shout it)

Now what was your question?



More information about the Python-list mailing list