program to add first and last digit of a number in python

Solutions on MaxInterview for program to add first and last digit of a number in python by the best coders in the world

showing results for - "program to add first and last digit of a number in python"
Bruno
07 Jan 2018
1n = int(input("Enter any number : "))
2number = str(n)
3first = int(number[0])
4last = int(number[-1])
5print(f"sum of {first} and {last} is : ",sum)