+ 16

[ASSIGNMENT] CHALLENGE🚩🚩: Reverse A Number

In this task, you need to accept input from user. Then, you have to display the reverse version of the input. For example: *input: 678 output: 876 input: 9077 output: 7709 Note: You can use String reverse algorithm to perform this easy task. You can use any languages. https://code.sololearn.com/c7YzIxkNuFu7/?ref=app //already submitted as Assignment

2nd Apr 2018, 11:01 AM
Muhd Khairul Amirin
Muhd Khairul Amirin - avatar
23 Answers
+ 6
Here is mine very Easy to make with Stringbuffer https://code.sololearn.com/cmR4rd11f4P2/?ref=app
2nd Apr 2018, 11:30 AM
🦋FEATHER🦋
🦋FEATHER🦋 - avatar
+ 28
#My try in Ruby 😎 p gets.reverse.to_i
2nd Apr 2018, 1:57 PM
🌛DT🌜
🌛DT🌜 - avatar
13th Apr 2018, 7:17 PM
MeanMachine
MeanMachine - avatar
+ 22
https://code.sololearn.com/cD9O9lkStZIP/?ref=app
2nd Apr 2018, 11:41 AM
Danijel Ivanović
Danijel Ivanović - avatar
+ 21
top 1 trending code is the one in c++ 😁
2nd Apr 2018, 11:07 AM
Lee See Raa
Lee See Raa - avatar
+ 11
# Python print(input()[::-1])
2nd Apr 2018, 12:44 PM
Pedro Demingos
Pedro Demingos - avatar
2nd Apr 2018, 1:32 PM
Baraa AB
Baraa AB - avatar
2nd Apr 2018, 11:35 AM
Paul
Paul - avatar
+ 8
🌛DT🌜 wow!! amazing 😂💚💚
2nd Apr 2018, 4:45 PM
Baraa AB
Baraa AB - avatar
+ 7
What should 700 be? 007 or 7?
2nd Apr 2018, 11:15 AM
Paul
Paul - avatar
2nd Apr 2018, 11:18 AM
Sudarshan Rai
Sudarshan Rai - avatar
+ 7
Oneliner without any string method https://code.sololearn.com/cUZMG2p7jSR9/?ref=app
2nd Apr 2018, 2:07 PM
VcC
VcC - avatar
+ 5
Paul Jacobs Pedro Demingos This wont work for numbers like 100 ....i mean any number ending with 0.
2nd Apr 2018, 4:58 PM
Mitali
Mitali - avatar
+ 5
Mine prints 001 for 100. Isn’t that the idea? If it’s not, # this prints 1 for 100: print(int(input()[::-1]))
2nd Apr 2018, 5:14 PM
Pedro Demingos
Pedro Demingos - avatar
+ 5
Pedro Demingos Opps.Sorry.
2nd Apr 2018, 5:18 PM
Mitali
Mitali - avatar
+ 5
Pedro Demingos Oneliner codes...thats the beauty of python.👍
2nd Apr 2018, 5:18 PM
Mitali
Mitali - avatar
+ 5
I did ask. And looked at some other codes. They print 1 for 100.
2nd Apr 2018, 5:22 PM
Paul
Paul - avatar
+ 4
2nd Apr 2018, 1:56 PM
Heji Palaña
Heji Palaña - avatar
+ 4
s="NUMBER HERE IN STRING"; StringBuffer buff=new StringBuffer(s); StringBuffer x=buff.reverse(); print(x); Ofcourse using Java. :)
2nd Apr 2018, 7:48 PM
SatyaJit Pradhan
SatyaJit Pradhan - avatar
+ 2
I don't think I'm there yet in Python...
3rd Apr 2018, 3:59 AM
TheEpicWobbuffe
TheEpicWobbuffe - avatar