Get answer of your all questions and doubts! ➤

Question
What are three internal key-attributes of a value-variable in Python? Explain with example.

[Computer Science Class – 11 Sumita Arora solutions. Chapter 6 – Data Handling.]

Answer

Three internal key-attributes of a value-variable in Python are:

  1. Type
  2. Value
  3. Id

For example:

a = 9

The type of ‘a’ is int which can be found with the built-in function type() like this:
type(a).

Value can be found using the built-in function print() like this:
print(a).
It will give the output as 9 which is value contained in variable ‘a’.

Id is the memory location of the object which can be determined using built-in function id() like this:
id(a)

Leave a Comment

Your email address will not be published. Required fields are marked *