Question
Following was the assignment Option #1: String Values in Reverse Order Assignment Instructions Write a Python function that will work on three strings. The function
Following was the assignment
Option #1: String Values in Reverse Order
Assignment Instructions
Write a Python function that will work on three strings. The function will return to the user a concatenation of the string values in reverse order. The function is to be called from the main program.
In the main program, prompt the user for the three strings and pass these values to the function.
My answer was:
def concateStrings(string1, string2, string3): return string3+" "+ string2+" "+string1 def main(): string1 = input("Enter string1: ") string2 = input("Enter string2: ") string3 = input("Enter string3: ") result = concateStrings(string1,string2,string3) print(result) main()
Got the following feedback with deduction
"The string reverse logic is missing- every word in the string needed to be reversed."
I don't know what I'm missing with my answer. The output shows what I was looking for. Can you help?
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started