global-variable tag

11 questions


1 answers
359 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
148 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

1 years ago

1 answers
91 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
141 views
0
Do you happen to know issues like JavaScript?

<script language=JavaScript> myTickets = new Array(); startPosArr = new Array(); endPosArr = new Array(); selItem; eee2 = 0; function setMyTicketList(){ alert(^^ : + eee2);}The following error...


1 answers
103 views
0
How do you define global variables in Java?

How do you define global variables in Java?

1 years ago

1 answers
132 views
0
How to use C language variables - global variables?

I am posting because I have a question about using the C language variable.If I use the code that I'm trying to make as an easy example,(It's not a real code, it's a simple example made with only a pa...

1 years ago

1 answers
104 views
0
Python Unbound LocalError

If you run the code below, you will receive UnboundLocalError. What's wrong?counter = 0def increment(): counter += 1increment()


1 answers
85 views
0
cLanguage)Ask global variables.

void set(int h, int m);int h,m,;int main(void){ set(h,m); printf(%d%d, h,m);}void set(int h, int m){ printf (Enter the first hour (24 hours): ); scanf(%d%d, &h, &m); }I'd like to initialize th...

1 years ago

1 answers
118 views
0
About using and updating Python global variables

from settiing import *from boy import *def start(): value = web() // Import data from the web (value=[4,5,6]) gosetting(value) goBoy()a = 1b = 2c = 3def goSetting(value): global a global b globa...

1 years ago

1 answers
124 views
0
Swap function global variable is not possible

int a,b;void swap(int a, int b);int main(){scanf(%d %d,&a,&b);if(a>b) swap(a,b);printf(%d %d, a,b);for(int i=a;i<=b;i++) printf(%d ,i);}void swap(int a, int b){ int temp; temp=a; a=b; b=...

2 years ago
- 1 - »

© 2024 OneMinuteCode. All rights reserved.