Question: * Create a variable outside of a function, and use it inside the function x = awesome def myfunc ( ) : print (
Create a variable outside of a function, and use it inside
the function
x "awesome"
def myfunc:
printPython is x
myfunc
Run this and add the screenshot of it as your submission.
Next, modify your code, and create a variable with the
same name inside a function, this variable will be local,
and can only be used inside the function. The global
variable with the same name will remain as it was, global
and with the original value. Run this and add the
screenshot of it as your submission.
"awesome"
def myfunc:
"fantastic"
printPython is x
myfunc
printPython is x
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
