Practice Real Company Assessment Patterns • Latest 2025–2026 Mock Tests

Programming Exercises

Reverse the digits of a number.

Medium

Problem Statement

Reverse the digits of a number.

Sample Input

12345

Sample Output

54321

Limits

Time: 2s · Memory: 256 MB

Code Editor
00:00
def reverse_digits(): n = 12345 # Your code here return
Log in or sign up to run or submit your code.Log inSign up
Input
12345
Expected Output
54321