Write a program to find out the name of an object in python.

Answer Posted / chaitanya

The object doesn’t have any name and there is no way the can be found out for objects. The assignment is used to bind a name to the value that includes the name of the object that has to be bound by a value. If the value is callable then the statements are made true and then the program followed can be used to find the reference name of an object.

class try:

pass

B = A

a = B()

b = a

print b

<__main__.try instance at 0x16D07CC>

print b

The class consists of name and the names are invoked by using the the variable B that creates an instance for the class try. The method is to find out from all the namespaces that the object exists and then print the name of the object.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is python explain the advantages of using python?

443


How do you launch sub-processes within the main process of a python application?

438


What is numpy? Is it better than a list?

494


How do you define a function in python 3?

439


What is the difference between uuid and guid?

455






What do you know about iterator protocol?

480


What is a numpy array?

449


How do you break a while loop?

465


What are the differences between python 2.x and python 3.x?

524


What does the meaning of slicing in python?

456


How to find the index of an item given a list containing it in python?

449


Will python work multiple inheritance?

444


What is python best for?

433


What is “call by reference” in python?

469


Are lambda functions faster python?

465