Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


What is the procedure to extract values from the object used in python?



What is the procedure to extract values from the object used in python?..

Answer / chaitanya

To extract the value it requires the object type to be defined and according to the object type only the values will be fetched. The values will be extracted as:

• If the object is a tuple then PyTuple_Size() method is used that returns the length of the values and another method PyTuple_GetItem() returns the data item that is stored at a specific index.

• If the object is a list then PyListSize() is having the same function that is defined for the tuple and PyList_GetItem() that also return the data items at a specified index.

• Strings uses PyString_Size() to return the length of the value and PyString_AsString() that return the pointer to its value.

• To check the type of the object and the extracted values use of methods like PyString_Check(), PyTuple_Check(), PyList_Check(), etc are used.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More Python Interview Questions

What is none python?

0 Answers  


Explain me five benefits of using python?

0 Answers  


Which ide is best for python on windows?

0 Answers  


Explain how to redirect the output of a python script from standout(ie., A monitor) on to a file?

0 Answers  


Which operator will be helpful for decision making statements?

0 Answers  


How do I get numpy in python?

0 Answers  


How to implement the decorator function, using dollar ()?

0 Answers  


Is there an inherent do-while loop in Python?

2 Answers  


Mention at least 3-4 benefits of using python over the other scripting languages such as javascript.

0 Answers  


Whenever python exists why does all the memory is not de-allocated / freed when python exits?

0 Answers  


What is pip and when it is used ?

0 Answers  


What is xrange in python?

1 Answers  


Categories