Saturday, November 28, 2026

What's the output of this simple Python program? - Don't google

Python Program


emp_list = [ 10, 20, 30, 40 ]

for item in emp_list:
    if item < 30:
       emp_list.remove(item)

print(emp_list)


Output is NOT  

[ 30, 40 ]


Register for more technical hacks at WhatsApp - +91-9790881159

No comments:

Post a Comment