• Python question of the day

    What would be the output of executing the following code:
    import numpy as np
    s=j=k=0
    for e in np.eye(4)*5:s+=e[j];e+=1;j+=1
    print(s)
     4
     5.0
     20.0
     SyntaxError
    Explanation:
    It's the sum of the elements in an identity matrix


    Top 100 python interview questions:






datai analytics