CBSE Class 12 Computer Science
Question 100 of 105
Python Revision Tour II — Question 7
Back to all questions 7
Question Define two variables first and second so that first = "Jimmy" and second = "Johny". Write a short python code segment that swaps the values assigned to these two variables and prints the results.
first = "Jimmy"
second = "Johny"
temp = first
first = second
second = temp
print("first =", first)
print("second =", second)first = Johny
second = Jimmy