Avatar ·

Global variables in Python: save the local variable from call to call function

📁 функция, python, ии, работа

I have a function that needs to be kept from calling to call, while this value is used only in this function. How to use global variables in Python? I tried to write something similar:

  someglobalvar =  0    DeF   Incrimentglobalvar  ()  someglobalvar = someglobalvar +  1      

but this code does not work. Maybe there are other ways to solve this problem?