Informatics Practices
Write the output of the following:
for i in [100,200,300] :
print (i)
Python Control Flow
3 Likes
Answer
100
200
300
Working
The above code iterates through each element in the list [100, 200, 300] using a for loop. During each iteration, it prints the current element i.
Answered By
3 Likes
Related Questions
Find the output of the following program segment:
i = 0; sum = 0 while i < 9: if i % 4 == 0: sum = sum + i i = i + 2 print (sum)Write the output of the following:
for i in '123' : print ("Message",i,)Write the output of the following:
for j in range (10,6,-2) : print (j*2)Write the output of the following:
for x in range (1, 6) : for y in range (1, x+1): print (x, ' ', y)