Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 13
"backwards" is spelled b a c k w a r d s where is the problem? 🙄
4th Aug 2021, 11:01 AM
Jan Markus
+ 11
Wayne , there are various ways of doing this task. one of them could be recursion. before we are going to help you, please present your attempt here. if you haven't done a try by yourself so far, please do so. create your code in playground and post the link to it here. please also provide a proper task description with sample of input and output. thanks!
4th Aug 2021, 8:01 AM
Lothar
Lothar - avatar
+ 3
To reverse a string you mean? You can do this string = 'hey' string = string[::-1] print(string) Output: yeh And if you want to separate each letter of the word (i think is what you mean of spell) you can do this: def separate (word): return [char for char in word] string = separate(string) output: [‘y’, ‘e’, ‘h’]
5th Aug 2021, 5:00 PM
MasterTom18
MasterTom18 - avatar
+ 2
Hi Wayne! Using for loop is your another choice. You can make a 2/3 lines code with the help of some in-built functions like, range() and len()
4th Aug 2021, 8:14 AM
Python Learner
Python Learner - avatar
+ 2
Wayne Spell backwards what? If it's a text, then slicing it might help: text[::-1]
4th Aug 2021, 9:49 AM
Calvin Thomas
Calvin Thomas - avatar
+ 2
print(("Hello World!")[::-1])
5th Aug 2021, 6:01 AM
Sancho Godinho
Sancho Godinho - avatar
+ 1
Wayne Your question appears to a duplicate please use the searchbar before asking. Please use the forum guidelines provided below and use the 8 rules for getting help from the community. https://www.sololearn.com/Blog/38/8-simple-rules-to-get-help-from-the-community Your question will be marked for deletion. Reason duplicate threads are removed to: Focus substantially similar discussion in one thread and to prevent forums being cluttered with multiple threads on the same topic. https://www.sololearn.com/Discuss/1316935/?ref=app https://www.sololearn.com/discuss/1613864/?ref=app https://www.sololearn.com/discuss/2280068/?ref=app https://www.sololearn.com/discuss/1362802/?ref=app https://www.sololearn.com/discuss/2638450/?ref=app https://www.sololearn.com/discuss/1525821/?ref=app https://www.sololearn.com/discuss/1748913/?ref=app https://www.sololearn.com/discuss/2219532/?ref=app https://www.sololearn.com/discuss/1485001/?ref=app
6th Aug 2021, 12:15 AM
BroFar
BroFar - avatar
0
Can u also use recursion or is it only with recursion
4th Aug 2021, 7:58 AM
Jprogsie
Jprogsie - avatar
5th Aug 2021, 3:29 AM
Jprogsie
Jprogsie - avatar
0
You can use recursion
5th Aug 2021, 7:06 PM
Abdelhaq El Amraoui
Abdelhaq El Amraoui - avatar
- 3
By using slicing
5th Aug 2021, 4:43 PM
Shanley Josh Cantos
Shanley Josh Cantos - avatar