Develop a Python script that will display the exponentiation of the numbers in every line of a text file where the first number is the base and the second number is the exponent.
TEXT FILE
8 3
4 5
6 2
OUTPUT
512
1024
36
1
Expert's answer
2022-05-30T08:16:03-0400
txt = 'text.txt'
with open(txt) as file:
forlinein file:
b, p = line.split()
b, p = int(b), int(p)
print(pow(b, p))
Finding a professional expert in "partial differential equations" in the advanced level is difficult.
You can find this expert in "Assignmentexpert.com" with confidence.
Exceptional experts! I appreciate your help. God bless you!
Comments