Consider below code
a,b="hello","hello"
print id(a),id(b)
output
28954752 28954752
output will be same for char,string etc but now consider a list
list1=[1,2,3,4]
list2=[1,2,3,4]
print id(list1),id(list2)
output
139706054367136 139706054368360
we can see address is given is different in case of list/tuple/dict, if they are reference variables so why string gives same address for same values?