41 questions
x = 0def A(): x = 10 # Local variable of A x def B(): global x # Use the global variable outside of the current function Allocate 20 to the regional variable x of x = 20 # A B() print(x) # Local var...
What should I do if I want to know what variables exist or not?Is there any other way than to write an exception like my code?try: myVarexcept NameError: # # Do something.
The professor told me to use the discharge variable only when it's really inevitableWhy is that?If there are more functions, it's hard to transfer factorsThis is too much trouble
I've been programming for years, and recently started learning Python. The code below works normally on Python 2.5 and 3.0 as I expected :a, b, c = (1, 2, 3)print(a, b, c)def test(): print(a) print(b)...
I want to dynamically generate variables using repetitive statements in Python. Please suggest a creative way.
I want to share and write global variables of other files like c++.For example, path.The network paths required for the file py are All specified in the global function I want to take global variables...
In C language, there is a function called sizeof as a function to check the size of a variable.Is there any function or class in Java that acts like size of C?If not, is there any way to print out the...
I'm writing multi-threading the enemy's actions as I make the Java console game.Make the thread a separate class and start() from the main.The structure in the thread is rotated by a repeating door so...
Hello, everyone It's been a while since I stopped by.I'd like to ask you a question about Shared Preferences on Android.I don't mean to ask you how to use it Usually, when sharing values stored in var...
When you click on the element $gall, the slide show screen $zoom appears in the pictureI want to click on the $previewImg below to run the slide() function, but I want to cover the new variable i with...
- 1 - | » |
© 2024 OneMinuteCode. All rights reserved.