Computer Science

Predict the output of the following code fragments:

for x in [1,2,3,4,5]:
    print (x)

Python

Python Control Flow

10 Likes

Answer

1
2
3
4
5

Working

x will be assigned each of the values from the list one by one and that will get printed.

Answered By

4 Likes


Related Questions