Write a program to input a number and then print
its first and last digit raised to the length of the
number (the number of digits in the number is the
length of the mumber).
Answers
Answered by
4
n = int(input("enter num: "))
digits = [int(n) for n in list(str(n))]
print(f"{digits[0] ** len(digits)}\n{digits[-1] ** len(digits)}")
Answered by
1
Answer:
n = int(input("enter num: "))
digits = [int(n) for n in list(str(n))]
print(f"{digits[0] ** len(digits)}\n{digits[-1] ** len(digits)}")
Similar questions
English,
3 months ago
Business Studies,
3 months ago
English,
7 months ago
Math,
1 year ago
Math,
1 year ago