MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/learnpython/comments/1wyakx3/printing_local_variables_outside_of_a_function/pe107aw/?context=3
r/learnpython • u/[deleted]
[deleted] — view deleted post
14 comments sorted by
View all comments
Show parent comment
1
Don't use global variables unless absolutely necessary. It will just cause headaches and is definitely a code smell.
Plus, if you're returning it, then making it global is unnecessary.
View all comments
Show parent comment
1
u/Outside_Complaint755 Oct 05 '26
Don't use global variables unless absolutely necessary. It will just cause headaches and is definitely a code smell.
Plus, if you're returning it, then making it global is unnecessary.