Question #118496

9.10 Code Practice: Question 1

Write code that takes in two words from user input. Then, the program should swap the two variables that hold the inputs and print the words in backward order.

Expert's answer

#Promt user to input words
word1 = input("Enter the first word: ")
word2 = input("Enter the second word: ")

#print the words in backward order
print(word2, word1)
LATEST TUTORIALS
APPROVED BY CLIENTS