How can i do this? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
0

How can i do this?

You are required to complete the function reverse(x). given a string "x" as an input it is expected to return that same string but reversed.¶ Example: input : "again" output: "niaga"

22nd Apr 2021, 6:19 AM
I_Tech_2003
I_Tech_2003 - avatar
3 Réponses
+ 2
Hi! Please, for better help for you show us your code attempt!
22nd Apr 2021, 6:25 AM
Yaroslav Vernigora
Yaroslav Vernigora - avatar
+ 1
Thank you bro i'l done
22nd Apr 2021, 6:33 AM
I_Tech_2003
I_Tech_2003 - avatar
0
Its very easy You can use "for loop" for that, Like this :- st= input('enter the text: ') ln= len(st)+1 out_st= '' for i in range(1, ln): out_st += st[-i] print(out_st)
22nd Apr 2021, 6:29 AM
Priyanshu Kumar
Priyanshu Kumar - avatar