whats wrong with dis code? the problem is internet media types...........the code is in python.

n,q=map(int,input().split())

d=dict()

for i in range(n):

    s1,s2=map(str,input().split())
    
    d[s1]=s2
for j in range(q):
    s3=input();k=len(s3)
    
    if '.' in s3:
    
        j=s3[::-1].index('.')
        i=k-j-1
        value=s3[i+1:]
        if value in d:
            print(d[value])
        else:
            print('unknown')
    else:
        print('unknown')

are you sure it is input().split()?? Shouldn’t it be raw_input().split()?? PS: I am not so sure in this.

1 Like