Question: Please code in Coral or python, (preferably coral) Here, we investigate what happens when we change the value of a variable in a function. Your
Please code in Coral or python, (preferably coral)
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. Did you get what you expected? We will explain this behavior later in the course.
Default template code:
# 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
Get step-by-step solutions from verified subject matter experts
