I love studying
Write a program that stores three strings “I”, “love”, and “studying”. The three strings should then be concatenated into a single message. The message should then be printed out to the user.
I love studying
store "I" as part1 store "love" as part2 store "studying" as part3 concatenate the message = part1 + " " + part2 + " " + part3 print(message)
part1 = "I" part2 = "love" part3 = "studying" message = part1 + " " + part2 + " " + part3 print(message)
# Assign the three strings to variables part1 = "I" part2 = "love" part3 = "studying" # Concatenate all three strings into a message (including spaces!) message = part1 + " " + part2 + " " + part3 # Display the message to the user print(message)
Extension
Rewrite the program to get the input from the user rather than assigning the variables in the code.
Enter the first part of the message: I Enter the second part of the message: love Enter the third part of the message: studying I love studying