Sample run:
“I love programming” –> “I evol gnimmargrop”
[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!
1 Answers
def rev_string(phrase):
phrase_lst = phrase.split(‘ ‘)
rev_phrase = ”
for p in phrase_lst:
rev_phrase += p[::-1] + ‘ ‘
return rev_phrase.strip()
rev_string(“I love programming”)
[Content Sponsor #1] Start learning through a free trial on Datacamp!
[Content Sponsor #2] $750 discount on any springboard courses including Data Science Career Track which comes with a Job Guarantee!
Your Answer