Q. Define two variables first and second show that first = "jimmy" and second = "johny". Write a short python code segment that swaps the values assigned to these two variable and print the results.


You can understand by Watching video :-



Answer :-

first = "jimmy "
second=  "johny"
first , second = second , first
print("first  = ", first )
print("second  = " , second )

Output :-

first  =  johny
second  =  jimmy

>>>


Post a Comment

You can help us by Clicking on ads. ^_^
Please do not send spam comment : )

Previous Post Next Post