first and last digit
output:print the first digit in first line and second digit in second line
input 1:1456
output:1
6
input 2:9821
output:9
1
#The second solution, if our input values are necessarily a int
a = int(input('write numbers'))
b = a % 10
c = str(a)
print(f'{c[0]} \n{b}')
Comments
Leave a comment