Python Forum
How to print variables in function?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to print variables in function?
#4
(Dec-31-2022, 11:54 AM)samuelbachorik Wrote: I got it now, thank you for help

Is the solution a secret? For the benefit of other people reading this question, you should give the answer so everyone can learn from it.

The solution I would use is locals().
Reply


Messages In This Thread
RE: How to print variables in function? - by stevendaprano - Dec-31-2022, 11:12 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  print doesnt work in a function ony 2 1,081 Mar-11-2024, 12:42 PM
Last Post: Pedroski55
  How to print the output of a defined function bshoushtarian 4 2,271 Sep-08-2022, 01:44 PM
Last Post: deanhystad
  User-defined function to reset variables? Mark17 3 3,223 May-25-2022, 07:22 PM
Last Post: Gribouillis
  Why does absence of print command outputs quotes in function? Mark17 2 2,090 Jan-04-2022, 07:08 PM
Last Post: ndc85430
  return vs. print in nested function example Mark17 4 2,723 Jan-04-2022, 06:02 PM
Last Post: jefsummers
  output correction using print() function afefDXCTN 3 13,444 Sep-18-2021, 06:57 PM
Last Post: Sky_Mx
  print function output wrong with strings. mposwal 5 4,248 Feb-12-2021, 09:04 AM
Last Post: DPaul
  Output with none, print(x) in function Vidar567 3 3,753 Nov-24-2020, 05:40 PM
Last Post: deanhystad
  Do I have to pass 85 variables to function? Milfredo 10 6,273 Sep-26-2020, 10:13 PM
Last Post: Milfredo
  Print variable values from a list of variables xnightwingx 3 3,420 Sep-01-2020, 02:56 PM
Last Post: deanhystad

Forum Jump:

User Panel Messages

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