From 25a118f98a7a684ca92e931cc76ae582cdc5e9da Mon Sep 17 00:00:00 2001 From: Sowmya Yellapragada <56383804+sowmya8900@users.noreply.github.com> Date: Tue, 28 Jul 2020 22:31:42 +0530 Subject: [PATCH] Create SolutionBySowmya.py --- Basic/Reverse A Given Number/SolutionBySowmya.py | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 Basic/Reverse A Given Number/SolutionBySowmya.py diff --git a/Basic/Reverse A Given Number/SolutionBySowmya.py b/Basic/Reverse A Given Number/SolutionBySowmya.py new file mode 100644 index 0000000..5f15ffd --- /dev/null +++ b/Basic/Reverse A Given Number/SolutionBySowmya.py @@ -0,0 +1,9 @@ +def reverse_number(num): + l = [] + num_to_list = list(map(int, str(num))) + for i in num_to_list: + l.append(str(i)) + l.reverse() + print (''.join(l)) +num = int(input("Enter any positive integer!")) +reverse_number(num)