Swaping of a two number
using funcion in python
Answers
Answered by
1
Answer:
a=10
b=20
a=a+b
b=a-b
a=a-b
print(a,b)
Answered by
0
Below are the program for the above question:
Explanation:
def swaping_function(first_number,second_number):#function definition to swap the number.
replace=first_number #operation to swap the number
first_number=second_number#operation to swap the number
second_number=replace#operation to swap the number
return "The first number is "+str(first_number)+" and the second number is: "+str(second_number)#return the number after swaping.
Code Explantion:
- The above is a function which is defined in the python language which takes the two value and returns the value after swapping.
- If the user wants to call the function then he can simply write this function in the print function and pass the value which he wants to pass.
Learn More:
- Python: https://brainly.in/question/14689905
Similar questions