NPS-INR-Codewars-2022

The 2022 edition of the NPS Indiranagar interhouse Cyber Programming contest.

View on GitHub

Roadster to Bugatti?

Problem Statement:

Elon Musk Reach mars, and takes his Tesla Roadster for a JoyRide! But the moment he switches on the Engine, he realises that his electric car is now a 12.0L W16 with 8 Speed Transmission. HOW??? Then he realises mars is nothing but a Real life scene of the movie Tenet. Everything here was inverted! Elon, as much as he hates to do so, has asked you for help Elon now wants you to make a code, which will take each word in a string, and invert each and every WORD of the string.

Input Format:

Output Format:

Constraints:

Sample Input:

oY norI nam si !ereht

Sample Output:

Yo Iron man is there!

Solution:

def reverse(sen):
    words = sen.split(" ")
    inv = [word[::-1] for word in words]
    strr = " ".join(inv)
    return strr
 
sen = input()
print(reverse(sen))