Practice Interview Questions
| Question | Status |
|---|---|
Write a Python function that takes a string as input and returns the string with the words in reverse order. Each word in the string is separated by a single space. Ensure that there are no extra spaces in the output.
Example:
Input: "Hello World"
Output: "World Hello"
Input: "Python is fun"
Output: "fun is Python"
Write a Python function that takes a string as input and returns the string with the words in reverse order. Each word in the string is separated by a single space. Ensure that there are no extra spaces in the output.
Example:
Input: "Hello World"
Output: "World Hello"
Input: "Python is fun"
Output: "fun is Python"