[Solved] session variable vs normal variable? [closed]

Where is the value stored? That depends on the PHP configuration. By default, session variables are serialized and written into a file on the server’s file system. On each page view that starts the session, they are unserialized and accessible from the $_SESSION array. It’s possible to override the default session handler so that you … Read more

[Solved] List in list changes but var in list not? [duplicate]

The problem you’re experiencing is due to a misunderstanding of lists, list-references, and possibly the concept of mutability. In your case, you are binding the name user_data to a list object. In other words, user_data acts as a list-reference to the actual list object in memory. When you say user_list.append(user_data), all you’re doing is appending … Read more

[Solved] How can I use the same name for two or more different variables in a single C# function? [closed]

You can make the scopes non-overlapping using braces: switch (something) { case 1: { int Number; } break; case 2: { float Number; } break; } Going out of scope is the only way a variable name is “deleted” in the sense you are talking about. Notably and unlike some other languages, C# doesn’t allow … Read more

[Solved] Naming a variable based on another variable

No, you can’t, and it makes no sense honestly to have a feature like that. If you want , you can use a dictionary, where you can have the key be a string: Dictionary<string, RectangleShape> shapes = new Dictionary<string, RectangleShape>(); shapes.Add(“nameTheKey”, new RectangleShape( … )); Then you can simply read the “variable” like shapes[“nameTheKey”] solved … Read more

[Solved] python variables between functions

Working example with global variable and two windows. It uses only one mainloop() and Toplevel() to create second window. import tkinter as tk # — functions — def main(): #inform function to use external/global variable global int_var # only if you will use `=` to change value root = tk.Tk() root.title(“Root”) # change global variable … Read more

[Solved] declaring and assigning variable [closed]

Instead of writing the following which id not valid Java, Paraula tipo1; tipo1 = { Paraula.lletres[0] = ‘t’; Paraula.lletres[1]=’1′; Paraula.llargaria = 2; perhaps you intended to write Paraula tipo1 = new Paraula(); tipo1.lletres[0] = ‘t’; tipo1.lletres[1]=’1′; tipo1.llargaria = 2; However a much cleaner way to do this is to pass a String to the constructor … Read more