+ 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
23 Answers
+ 6
Here is mine
very Easy to make with Stringbuffer
https://code.sololearn.com/cmR4rd11f4P2/?ref=app
+ 28
#My try in Ruby 😎
p gets.reverse.to_i
+ 22
https://code.sololearn.com/cD9O9lkStZIP/?ref=app
+ 21
top 1 trending code is the one in c++ 😁
+ 11
# Python
print(input()[::-1])
+ 8
A oneliner in python:
https://code.sololearn.com/chx7tE2Ydhbv/?ref=app
+ 8
🌛DT🌜 wow!!
amazing 😂💚💚
+ 7
What should 700 be? 007 or 7?
+ 7
with my favourite language
https://code.sololearn.com/cFOF23tVP47c/?ref=app
+ 7
Oneliner without any string method
https://code.sololearn.com/cUZMG2p7jSR9/?ref=app
+ 5
Paul Jacobs Pedro Demingos
This wont work for numbers like 100 ....i mean any number ending with 0.
+ 5
Mine prints 001 for 100. Isn’t that the idea? If it’s not,
# this prints 1 for 100:
print(int(input()[::-1]))
+ 5
Pedro Demingos Opps.Sorry.
+ 5
Pedro Demingos Oneliner codes...thats the beauty of python.👍
+ 5
I did ask. And looked at some other codes. They print 1 for 100.
+ 4
this will work with numbers...
https://code.sololearn.com/ctIK6f6ZcN9d/?ref=app
+ 4
s="NUMBER HERE IN STRING";
StringBuffer buff=new StringBuffer(s);
StringBuffer x=buff.reverse();
print(x);
Ofcourse using Java. :)
+ 2
I don't think I'm there yet in Python...