Member Avatar
while t>0:
    m,n=input().split(" ")
    if n==1:
        print (m)
    elif n==2:
        print (m*m)%10
    elif n==3:
        print (m*m*m)%10
        print (m*m*m*m)%10

why this code is giving me NZEC error ? it is irritating me now. thanks

Use raw_input in Python2

Member Avatar

yes, i have already used that. again giving me NZEC. this is my first code in python :'(

I do not know how you produze non-zero exit code as you have not exit statemen in your code. Works for me.

for count in range(int(raw_input('Number of inputs: '))):
    m, n = raw_input('Pair of integers separated with space: ').split(" ")
    m, n = int(m) % 10 , int(n) % 4
    #print (m, n or 4)
    print pow(m, n or 4, 10)
Member Avatar

I think the NZEC is coming when input is very large. Can you tell why ?
secondly, Is there any limit on the python? Actually, I started learning python because there is no limit on data type and no limit of range. :'(