+ 1

Why is the reference count of b = 100

a = 42 # Create object <42> b = a # Increase ref. count of <42> c = [a] # Increase ref. count of <42> del a # Decrease ref. count of <42> b = 100 # Decrease ref. count of <42> c[0] = -1 # Decrease ref. count of <42> decreased. i expect it to increase cos it has been assigned another value. in the last second line

30th Sep 2017, 8:10 PM
stephen haokip
stephen haokip - avatar
1 Answer
+ 3
1st Oct 2017, 12:49 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar