Python program for swapping of two numbers using function

0
16
def swapping_numbers(num1, num2):
    temp=num1
    num1=num2
    num2=temp
    print("After swapping: ")
    print("num1: ",num1)
    print("num2: ",num2)
#____main_____
num1=int(input("Please enter first number: "))
num2=int(input("Please enter second number: "))
print("Before swapping: ")
print("num1: ",num1)
print("num2: ",num2)
swapping_numbers(num1, num2)
     
       Output:
             Please enter first number: 10
             Please enter second number: 15
             Before swapping: 
             num1:  10
             num2:  15
             After swapping: 
             num1:  15
             num2:  10

इन्हें भी देखें।

Python Programs के लिये यहाँ click करें।

 

 

 

 

Python program for swapping of two numbers using function write a program for swapping of two numbers using function in python write a Python program for swapping of two numbers using function write a program for swapping of two numbers write a python program to swap two numbers using function python program to swap two numbers using function program for swapping of two numbers in python python program for swapping two numbers swapping of two numbers using function in python swapping of two numbers in python using function python program to swap two numbers using functions swapping of two numbers in python program swapping program in python using function

 

LEAVE A REPLY

Please enter your comment!
Please enter your name here