sum of two digits in a number in Python

 Question:-

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-

  1. x="12345678912345" 
  2. print(int(x[0])+int(x[9])) 

Please visit my blog for more python basic Questions and Solutions.

Comments

Popular posts from this blog

Proassignmenthelp index 27

check whether the given input is alphabet, number or alphanumeric in python

Programmingshark index 19