EOF while parsing

Joined
Jun 11, 2009
Messages
3
Reaction score
0
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
 
Joined
Jun 11, 2009
Messages
3
Reaction score
0
I want the cursor to move to the next line when enter key is pressed...

Please help me.....
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,767
Messages
2,569,571
Members
45,045
Latest member
DRCM

Latest Threads

Top