TORONTO KIDS COMPUTER CLUB | PMCA Saturday 18:30 Python Homework 20.09.05.
18291
post-template-default,single,single-post,postid-18291,single-format-standard,ajax_fade,page_not_loaded,,no_animation_on_touch,qode-theme-ver-7.6.2,wpb-js-composer js-comp-ver-6.10.0,vc_responsive

PMCA Saturday 18:30 Python Homework 20.09.05.

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
No Comments

Sorry, the comment form is closed at this time.