I am new to python..I have written a code for the problem ETF in SPOJ in python but getting run time error
#Euler Totient Function
import sys
from math import sqrt
def etf(n):
i,res =2,n
while(i*i<=n):
if(n%i==0):
res-=res/i
while(n%i==0):
n/=i
i+=1
if(n>1):
res-=res/n
return res
def main():
t=input()
while(t):
x=input()
print str(etf(x))
t-=1
if __name__ == "__main__":
main()
While running the program if I press an enter key i get an error
SyntaxError: unexpected EOF while parsing
What should be the modification in my code for the program to work correctly
#Euler Totient Function
import sys
from math import sqrt
def etf(n):
i,res =2,n
while(i*i<=n):
if(n%i==0):
res-=res/i
while(n%i==0):
n/=i
i+=1
if(n>1):
res-=res/n
return res
def main():
t=input()
while(t):
x=input()
print str(etf(x))
t-=1
if __name__ == "__main__":
main()
While running the program if I press an enter key i get an error
SyntaxError: unexpected EOF while parsing
What should be the modification in my code for the program to work correctly