r/learnpython • • 29d ago

how do i overwrite a variable?

name = "Alice"

def func():
    name = "Bob"

func()

print(f"Hello, {name}!") # i want it to print bob
0 Upvotes

35 comments sorted by

View all comments

Show parent comment

3

u/illumas 29d ago

No. Just bugs.

1

u/Langdon_St_Ives 29d ago

Let's not split hairs. This time of year, demons captures it pretty well. 🎃