sum of two digits in a number in Python
What is the sum of tenth and unit digits in Python?
sum of two digits in a number in Python:-
it can be done in many ways but here i’m going to tell you a very easy steps in which code will be very optimized and cleared to you. Let’s see it’s example-
- x="12345678912345"
- print(int(x[0])+int(x[9]))
Please visit my blog for more python basic Questions and Solutions.
Comments
Post a Comment