Computer Science, asked by jacobjoslin15, 7 months ago

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 jai696
4

\large\mathsf\color{pink}{Solution\: using\: python\: 3}

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)}")

\large\mathsf\color{lightgreen}useful?\: \color{white}\longrightarrow\: \color{orange}brainliest!

Answered by Japji21
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