10 Sep PMCA Saturday 18:30 Python Homework 20.09.05.
Question:
Input a number (N) , reverse a number and add the reversed number to the number. For e.g. given a number 23 you need to add 23 and 32 (which is the reverse of 23) is 55.
Below is the code to reverse a string in python:
>>> x = "Apple" >>> y = x[::-1] >>> y >>> 'elppA'
Below are the sample run:
== RESTART: C:/Users/kelven/AppData/Local/Programs/Python/Python37-32/reverseSum.py == Enter a number:62 The addition of 62 and its revers 26 is 88
Sample Input: 23 Sample Output: The addition of 23 and its reverse 32 is 55
Sorry, the comment form is closed at this time.