x=3 x= x*x print x for the above i am not getting 9 on phyton 3 can i knwo why?
I am not studying Phython but I think it calls the first "x" which equals "3". I think you have change the next line to make it an update or something like that
I think you have to do "y=x*x"
@Harsha19111999 good point!
:)
No, you should be getting 9. It seems like the second line is being ignored
I'm a python noob, but to print x I think you simply do ``` x ``` and it should print out as whatever x's value is; ie:
That only works when running python in interactive mode, which will print the value of an expression so long as the value isn't `None`. If you actually want to write to stdout, then you would use print.
I see.
You're using Python v2 syntax in Python v3. Try: print( x )
Join our real-time social learning platform and learn together with your friends!