Explanation:
๐น for i in range(3):
This means the loop will run with:
๐น print(i)
Each value of i is printed:
๐น else: print("Done")
The else block attached to a for loop in Python executes after the loop finishes normally (i.e., without a break).
Final Output:
Summary:
The else block runs after the loop ends, making it useful for confirming completion or handling "no-break" conditions.


0 Comments:
Post a Comment