+ 3

What is the opposite of the global keyword in Python

The keyboard should make changing attribute in the local without changing the global variable possible https://code.sololearn.com/cJ26ZxDpV65g/?ref=app

29th Jun 2020, 11:56 AM
Adeniyi Olaitan
Adeniyi Olaitan - avatar
3 Antworten
+ 2
The opposite is local: https://pythonprogramming.net/global-local-variables/ I think local is default, so there is no keyword for it
29th Jun 2020, 12:54 PM
Alexander Thiem
Alexander Thiem - avatar
0
If you search for private keyword, you will get disappointed. There's a concept in python called "we are all responsible adults here" for this reason, there is no need/ explicit way for hiding a variable.
30th Jun 2020, 6:33 AM
Yannick Reiß
Yannick Reiß - avatar
0
local
30th Jun 2020, 10:49 AM
Pr0C0d3r
Pr0C0d3r - avatar