function(using variable inside function and updating)

 def update(x):

    x=10
print("inside the function:"+str(x))

x=5
print("outside the function:"+str(x))
update(x)
print("after executing the function:"+str(x))

"C:\Users\darul Haram\PycharmProjects\pythonProject2\venv\Scripts\python.exe" "C:/Users/darul Haram/PycharmProjects/pythonProject2/venv/Lib/Functions 2.py"
outside the function:5
inside the function:10
after executing the function:5

Process finished with exit code 0

Comments

Popular posts from this blog

XAMPP, SQL BASIC COMMANDS

The Minion Game Hackerrank Solution

Arrays - DS | HackerRank Solutions