Answer to Question #348339 in Python for kavya

Question #348339
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
1
Expert's answer
2022-06-06T08:57:23-0400
#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}')

Need a fast expert's response?

Submit order

and get a quick answer at the best price

for any assignment or question with DETAILED EXPLANATIONS!

Comments

No comments. Be the first!

Leave a comment

LATEST TUTORIALS
New on Blog
APPROVED BY CLIENTS