Hi I have a variables that is declared outsides fucntions. How can I use and change these variables inside function usign Python? thank you
0
0
1 User
1 UserPlease briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Follow this example to create a variable outside functions, and use it inside the functions: MyVariable = 99 #this is a global variable def changeAndPrint_GlobalVariable(): global MyVariable #use global variable in this function with "global" keyword print('Global variable "MyVariable" before changeRead more
Follow this example to create a variable outside functions, and use it inside the functions:
See less[crayon-6763d3913e724704348819/]
This code will print:
[crayon-6763d3913e72a349278620/]