Question: 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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!