Python Forum
Is it possible to create a variable with the name of an output of another variable
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Is it possible to create a variable with the name of an output of another variable
#3
(Jun-04-2018, 11:19 PM)volcano63 Wrote: Valid Python name must start either with a letter or underscore(s) - it cannot start with a digit.

There are several possible methods to create a variable name dynamically - and none of them is recommended. One of them - by use of globals and locals functions

I know that, it was an example. Can you just tell me how i would create a variable with the name of another variable's value?
Self-taught HTML, CSS, Python, and Java programmer
Reply


Messages In This Thread
RE: Is it possible to create a variable with the name of an output of another variable - by Panda - Jun-04-2018, 11:26 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  how solve: local variable referenced before assignment ? trix 5 261 9 hours ago
Last Post: trix
  Variable being erased inside of if statement deusablutum 8 348 10 hours ago
Last Post: ndc85430
  Cant contain variable in regex robertkwild 3 198 Jun-12-2024, 11:50 AM
Last Post: deanhystad
  is this a valid variable name? Skaperen 6 425 Jun-05-2024, 10:13 PM
Last Post: Skaperen
  Help with writing monitored data to mysql upon change of one particular variable donottrackmymetadata 3 455 Apr-18-2024, 09:55 PM
Last Post: deanhystad
  Commas issue in variable ddahlman 6 661 Apr-05-2024, 03:45 PM
Last Post: deanhystad
  Variable Explorer in spyder driesdep 1 376 Apr-02-2024, 06:50 AM
Last Post: paul18fr
  Mediapipe. Not picking up second variable stevolution2024 1 368 Mar-31-2024, 05:56 PM
Last Post: stevolution2024
Question Variable not defined even though it is CoderMerv 3 463 Mar-28-2024, 02:13 PM
Last Post: Larz60+
  optimum chess endgame with D=3 pieces doesn't give an exact moves_to_mate variable max22 1 363 Mar-21-2024, 09:31 PM
Last Post: max22

Forum Jump:

User Panel Messages

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