1.

For i in [ 2,4,6,8] : print(i//2)write it's output..plz ans fast​

Answer»

REQUIRED Answer:-

Given c∅de:

for i in [2,4,6,8]:

PRINT(i//2)

To FIND:

  • The output of the given c∅de.

Output:

1

2

3

4

Explanation:

The above loop iterates through the list - [2,4,6,8]. After each iteration, it displays the QUOTIENT obtained when each number in the list is DIVIDED by 2.

// operator is used in floor division. 2//2 = 1, 4//2 = 2 and so on.

So, it prints the values of 2//2, 4//2, 6//2 and 8//2.

Therefore, output goes like -

1

2

3

4



Discussion

No Comment Found