+ 1

Help with a python program

Can someone pls share the code of program for sum and reverse of digits of a number entered by a user (both in same loop).

12th Feb 2021, 3:39 PM
PRANJAL JAIN
PRANJAL JAIN - avatar
3 Answers
+ 11
print(input()[::-1])
12th Feb 2021, 3:41 PM
Ded
+ 2
a = [int(input("enter numbers : ")) for i in range(int(input(" how many numbers do you want to enter ? ")))] print("list is ", a) s = sum(a) print("sum of numbers is ",sum(a)) print('reversed sum number is',int(str(s)[::-1] ) ) # if you can't understand list comprehension, i have easy method too.
12th Feb 2021, 6:36 PM
Hemant Kosrekar
Hemant Kosrekar - avatar