Got a Doubt ! Wanting for your Help ! Plz make it ASAP !

Ned Batchelder ned at nedbatchelder.com
Fri Nov 22 10:18:36 EST 2013


On Friday, November 22, 2013 9:13:50 AM UTC-5, rusi wrote:
> On Friday, November 22, 2013 6:22:29 PM UTC+5:30, Bharath Kummar wrote:
> > Hello Sir/Mam, 
> > Could you please help me with my current research ?  Am implementing the concept in python language. 
> > My doubts are :
> > 1)  Is it possible to Retrieve the address of a variable in python ?
> > 2)  Is it possible to Delete the Address of the Variable and create a new dynamic address inside the compiler/interpreter itself ? 
> > 3)  Is it easy to find the Binary equivalence of a given Alphanumeric String ?
> > 4)  Is it possible to count the number of 1's in the Binary equivalence ? 
> > Could you PLEASE provide me with the codes (codes only for the asked queries) ? 
> > Your reply counts a lot for me and my research !  I love to explore more in python.
> 
> 1) id will give you addresses.  Except that
>    - not portable ie not guaranteed to be a m/c address
>    - its of an object not a variable
>    - if you are thinking C, its mostly useless
> 
> 2) del will delete objects -- like free in C
>    Except that like above, thinking in C will cause more problems than it solves

Not true: del doesn't delete objects. It merely removes references to objects.  Only if the object has no more references is the object deleted.

I tried my hand at explaining how names and values work in Python: http://nedbatchelder.com/text/names.html  Some people have found it helpful.

--Ned.



More information about the Python-list mailing list