Question #345751

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

Expert's answer

txt = 'text.txt'
with open(txt) as file:
	for line in file:
		b, p = line.split()
		b, p = int(b), int(p)
		print(pow(b, p))

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!

LATEST TUTORIALS
APPROVED BY CLIENTS