I want to learn what is the difference between two code lines.I couldn't find the difference.Whenever I try to run the second code,it doesn't affect string a.
Could someone tell me why the second code line doens't work?
a = "aaaaIstanbulaaaa".strip('a') #Affects the string
print(a)
>>>Istanbul
a = "aaaaIstanbulaaaa" #Doesn't affect the string
a.strip('a')
print(a)
>>>aaaaIstanbulaaaa