I am trying to find out a^b
in python, of really large no.s
My code is this:
t=raw_input()
c=[]
for j in range(0,int(t)):
n=raw_input()
a=[]
a,b= (int(i) for i in n.split(' '))
c.extend(pow(a,b))
for j in c:
print j
And I am getting an error like this:
raceback (most recent call last):
File "C:/Python26/lastdig.py", line 7, in <module>
c.extend(pow(a,b))
TypeError: 'int' object is not iterable
Whats wrong in my prob and is it an efficent way to find out powers of large numbers?