<p dir="ltr">Thank you for your time</p>
<div class="gmail_quote">On 11 Nov 2014 15:02, "Dave Angel" <<a href="mailto:davea@davea.name">davea@davea.name</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">William Becerra <<a href="mailto:wbecerra1@gmail.com">wbecerra1@gmail.com</a>> Wrote in message:<br>
> Hello, I'm new to programming using Python 2.7.8 and Windows 8 OSI'm reading How to Think Like a Computer Scientist - learning with pythonon chapter 12.2theres the following code: class Point:     passblank = point()blank.x = 3.0blank.y = 4.0<br>
>>>print blank.x<br>
> 3.0>>print blank.y4.0<br>
>>>print blank<__main__.point instance at 0x02B38E40><br>
><br>
> the author says the the < 0x02B38E40> is in hexadecimal form<br>
> heres is my question:How can i convert from hexodecimal form to decimal form?<br>
<br>
You don't care about that 0x02.. number, except to distinguish<br>
 this object from another. And in code you'd do that with the 'is'<br>
 operator.<br>
That hex number happens to be an address in memory for one of the<br>
 python implementations.<br>
<br>
> is there any source i can read on it?basically what i want is to use the attributes blank.x and blank.y as a single point like in  the mathematics format (x, y) co-ordinates so that i can workout distance<br>
> thank you<br>
><br>
><br>
<br>
<br>
If you want a tuple of the coordinates,  you could do (blank.x,<br>
 blank.y)  And if you need to do arithmetic,  go right ahead.<br>
 Like<br>
<br>
x, y = blank.x, blank.y<br>
dist_from_org = sqrt(x*x + y*y)<br>
<br>
<br>
<br>
--<br>
DaveA<br>
<br>
_______________________________________________<br>
Tutor maillist  -  <a href="mailto:Tutor@python.org">Tutor@python.org</a><br>
To unsubscribe or change subscription options:<br>
<a href="https://mail.python.org/mailman/listinfo/tutor" target="_blank">https://mail.python.org/mailman/listinfo/tutor</a><br>
</blockquote></div>