What is the output of the following? “`python import sys print(sys.getrefcount([1,2,3])) “`

Python Developer Hard

Python Developer — Hard

What is the output of the following? “`python import sys print(sys.getrefcount([1,2,3])) “`

Key points

  • `getrefcount` includes the function call in the count
  • The count includes temporary references
  • The output is not 0, 1, or 3

Ready to go further?

Related questions