Python Forum
Issues with storing variables outside of a function
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues with storing variables outside of a function
#7
Globals really should be avoided, as they lead to code that's hard to follow and maintain. Return values from functions instead.
Reply


Messages In This Thread
RE: Issues with storing variables outside of a function - by ndc85430 - Apr-30-2020, 07:54 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How to print variables in function? samuelbachorik 3 916 Dec-31-2022, 11:12 PM
Last Post: stevendaprano
  User-defined function to reset variables? Mark17 3 1,658 May-25-2022, 07:22 PM
Last Post: Gribouillis
  Storing variables into one file for use in multiple Jupyter notebooks devansing 1 1,745 Feb-05-2022, 10:04 AM
Last Post: ibreeden
  Conjugate Gradient having issues with defining A (function to solve [A]{x} = {b} ) DimosG 2 2,837 Sep-21-2021, 08:32 PM
Last Post: 1968Edwards
  Storing whole functions in variables dedesssse 3 2,102 Jul-29-2021, 09:17 PM
Last Post: deanhystad
  Do I have to pass 85 variables to function? Milfredo 10 4,324 Sep-26-2020, 10:13 PM
Last Post: Milfredo
  subprogram issues: cannot unpack non-iterable function object error djwilson0495 13 6,017 Aug-20-2020, 05:53 PM
Last Post: deanhystad
  print function help percentage and slash (multiple variables) leodavinci1990 3 2,499 Aug-10-2020, 02:51 AM
Last Post: bowlofred
  Temporarily storing the value of a function Men 6 2,818 Jun-21-2020, 06:43 PM
Last Post: Men
  Where to put the global keyword when assigning variables outside a function? new_to_python 8 3,049 Feb-09-2020, 02:05 PM
Last Post: new_to_python

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020