Janhvi is studying about the python list . She is facing the problem to predict the output
of following python code
1
lst1 = [10, 15, 20, 25, 30]
lst1.insert( 3, 4)
lst1.insert( 2, 3)
print (lst1[-5]
1
Expert's answer
2022-02-05T02:03:38-0500
Output:
SyntaxError: unexpected EOF while parsing
she will get the above syntax error since she has not put the closing bracket of the print function. If she can correct the error by putting the closing bracket she will get 3 as the output
Comments
Leave a comment