variable tag

41 questions


1 answers
362 views
0
I don't understand the Python global variable, so could you give me an answer?

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...

1 years ago

1 answers
100 views
0
To determine if a variable exists?

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.

2 years ago

1 answers
151 views
0
Why should global variables be written to a minimum?

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

2 years ago

1 answers
123 views
0
Python variable range problem

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)...

2 years ago

1 answers
122 views
0
Create variables dynamically using a repeat statement

I want to dynamically generate variables using repetitive statements in Python. Please suggest a creative way.

2 years ago

1 answers
96 views
0
I'd like to share the global variable of another file in Python.

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...


1 answers
120 views
0
[Java] A function that displays the size of a variable, such as sizeof

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...

2 years ago

1 answers
116 views
0
There is a problem with Java multi-threaded shared variables.

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...


1 answers
89 views
0
Is there a performance and security issue for Android Shared Preferences?

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...

2 years ago

1 answers
133 views
0
I want to initialize the variable in the jQuery function and pass it over.

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...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.