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-6763d21ae3b0c296749385/]
This code will print:
[crayon-6763d21ae3b11485258988/]