+ 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).
3 Answers
+ 11
print(input()[::-1])
+ 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.