-1

Say I have this:

greet = "hello world"

and I want to change the letters in this variable to something else.

Why does

greet = "g".join("hello world")

work, if strings are meant to be immutable?

print(greet)

hgeglglgog gwgogrglgd

khelwood
  • 52,115
  • 13
  • 74
  • 94
Phil Jay
  • 1
  • 3

0 Answers0