Name confusion

Report a typo

Imagine you helped organize a conference and printed everyone's name badges. People's names and surnames are stored in different variables. However, you confused the first name and the surname of one of the guests.

To correct the mistake, you need to swap the values of the variables name and surname. Write a part of code to do that and remember that Python allows you to swap two variables without a third one.

Write a program in Python 3
name = input()
surname = input()

name, surname = ...
___

Create a free account to access the full topic