Why does the code in python work differently in #1 and #2? #1 works when I make a new b string(like in #1-1 instead of #1-2), but #2 works without making a new list.
#1
#1-1
a="a:b:c:d"
b=a.replace(":","%")
print(b)
#1-2
a="a:b:c:d"
a.replace(":","%")
print(a)
#2
a=[1,3,2]
a.sort()
print(a)