Write a program in python reverse each and every word of the sentence using function taking string as input parameter from user and passing that string into function and also explain the logic
=======================================
input: 'Exam is gonna be good'
output: 'maxE si annog eb doog'
================
i am trying like this but getting confused '.'join([w::-1] for w in s.split()])
i need more focus on explanations because it is making me confuse i am not clear with concepts so please EXPLAIN CONCEPTS
' ' .join([words[::-1] for words in s.split() )
how to do it using list comprehension?
also another approach i have ' '.join(map(lambda x:x[::-1],s.split()))
=======================
i need proper explanations of both the approached in detail manner .
Also further resolve my query solving these three variants . Write program and also explain the logic of program:
1. I am in Delhi - I ma ni ihleD
2 I am in Delhi - ihleD ni ma I
3 I am in Delhi - Delhi in am I
====================================
Hence i request you to please demonstrate and explain the logic and also write complete program with explanations
Screenshot
Program
----------------------------------------------------------
Get Answers For Free
Most questions answered within 1 hours.