Call by refrence-
- call by refrence is a concept in which we call a function and pass the refrence of the variable.
program-
def function(l):
for i in range(len(l)):
l[i]=0
print("list inside function",l)
print("Enter number in list")
l=list(map(int,input().split()))
print("Given List is",l)
function(l)
print("List after function calling",l)
Enter number in list
1 2 3 4 5
Given List is [1, 2, 3, 4, 5]
list inside function [0, 0, 0, 0, 0]
List after function calling [0, 0, 0, 0, 0]