Can someone please help me to solve this question using Phyton? | SoloLearn: Learn to code for FREE!

+9

Can someone please help me to solve this question using Phyton?

https://www.sololearn.com/coach/51?ref=app

5/27/2020 8:22:11 AM

Hadif Syahputra

35 Answers

New Answer

+10

x = input() print(x[::-1]) This is the shortest method to solve the question But you have aready solved this question, right?

+14

Check my codes they all are in python

+12

https://code.sololearn.com/cd9mcOXAL2C0/?ref=app

+3

Ok then copy your code and paste here

+3

Can you explain why?

+3

Ok Thanks a lot I really appreciate your help Thanks guys

+3

A string can also be said as a list of letters... To get some part of a list:- List[start(default=0) : end(default=len(List)) : step(default=1)] So with this we are decreasing our steps by putting -1.... For understanding we can also type: print(x[0:len(x):-1])

+3

Ok👌 Thank you Thank you Thank you

+3

Try this code(this code is available for a sentence too andi not only words) sentence_in_english = input() sentence_inverse = [] for word in sentence_in_english.split(): word_inverse = word[::-1] sentence_inverse += word_inverse print("".join(sentence_inverse))

+3

You can see the explaination + solution here https://code.sololearn.com/W5Dyu7fP15N8/?ref=app BTW you misspelled Python

+3

Check this https://www.sololearn.com/coach/51?ref=app

+2

Phyton?

+2

(•‿•)

+2

It is so easy to reverse a word but if we need to reverse all words in a sentence, the code would be like this: def rev(string): b=list(string) b.reverse() sep='' l=sep.join(b) return l ourlang=input('Enter the sentence to be converted:') k=list(ourlang.split(' ')) for i in k: c= rev(i) print(c,end=' ')

+1

Please show up your attempt first and then if any errors found we will help you out...

+1

+1

I have posted my attempt

+1

Please post in over here or send a link of your code

+1

Hadif Syahputra The problem is that you didn't take the input at run time

+1

Hadif Syahputra You're Welcome 😅