Answered step by step
Verified Expert Solution
Question
1 Approved Answer
Use python Here, we investigate what happens when we change the value of a variable in a function. Your instructions are to define a function
Use python
Here, we investigate what happens when we change the value of a variable in a function. Your instructions are to
- define a function that takes a single argument, adds 10 to that argument, and then prints it out (all inside the function!)
- then, outside of the function, print out x, call your function using x as its argument, and print out x again
In total, x should be printed out 3 times.
# define your function here
x = 10
# print out the value of x
# call your function on x
# print out the value of x
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started