Computer Science, asked by aishwarya2942, 10 months ago


call the given python function using keyword argument with values 100 & 200.
def Swap(num1, num2):
num1,num2=num2,num1
print(num1,num2)
Swap(---------,----------)

Answers

Answered by Anonymous
4

Explanation:

def Swap(num1 , num2):

num1,num2=num2,num1

print(num1,num2)

Swap(100,200)

#output:

200100

algorithm of the program:

1)parametrize the function named Swap

2)pass the arguments num1 and num2

3)the function Swap then prints the swapped values 200100..(without any gaps as there is no spaces in the print statement)

some additional information:

1) Swapping refers to the interchanging of values.

e.g: a=10 and b=6

then, after swapping b= 10 and a=6..

2)the type of above function is called parametrized and non-returning type.so, the output gets directly executed in the function itself.had it been a returning type,then we would have to either invoke that function in print statement or store the value of in the variable.

Similar questions