Question: Write a single Python expression to remove all spaces from a string s and reverse the order of words. Example: for s= 'I Code
Write a single Python expression to remove all spaces from a string s and reverse the order of words. Example: for s= 'I Code In Python', the result will be 'PythonInCodeI' Hints: If the string was a list of words, how could you reverse it? Finally, how could you convert the result back to a string? Answer: Write a for-loop to append to a list res, in descending order, all multiples of 3 that are greater than or equal to 30 and less than or equal to 90. In other words, at the end of the loop, res == [90, 87, 84, 81, 78, 75, 36, 33, 30] .
Step by Step Solution
3.34 Rating (160 Votes )
There are 3 Steps involved in it
Solution To remove all spaces from a string s and reverse the order of words you c... View full answer
Get step-by-step solutions from verified subject matter experts
