Taking input Python

Thanks it really works

its working…bt it increased my code execution time by 5sec nd now it shows TLE(Time Limit exceeded) error.
Wanted to know what to do.
Is there any other way to handle this exception?

3 Likes

take custom input and run…

thank you so much !!

T=int(input())
for _ in range(T):
    N=int(input())
    d={}
    maxscore=0
    for i in range(N):
        p,s=map(int,input().split())
        if p in d.keys():
            d[p]=max(d[p],s)
        else:
            d[p]=s
        for j,k in d.items():
            if j<1 or j>8:
                pass
            else:
                maxscore+=k
    print(maxscore)

Traceback (most recent call last):
File “./prog.py”, line 23, in
EOFError: EOF when reading a line

help me to solve this error

Are you trying to Run without providing Custom Input?

for this, you can set the recursion limit bu following line :
sys.setrecursionlimit(10**6)

You need to provide an input type…
Like:
x = int(input())

thanks for the solution it worked like a charm
will it work for all the programs?

Yeah it worked

Its not working for me

it is just getting pass and doing nothing how do i handle the input man

please write the solution

Put try catch block and use custom inputs. Now run your program and submit.

thanks !!

thanks a lot !!! it really works … it resolved the EOF error in the Missing Point Question of July Challenge 2020

thanks it works

yes,should I WRITE SOLUTION IN a ITERATIVE APPROACH

Thank u dude it really worked

input() returns a string

so if you want to convert it to an integer then only int(iniput()) is used.

input() alone also works