178k views
3 votes
Question # 4

Math Formula
What is the output of the following program?

for num in range(4):
print (num * 2)

User SMAG
by
7.1k points

1 Answer

5 votes

The output will be:

0

2

4

6

This happens because the for loop iterates through the numbers in the range function and prints those numbers multiplied by two.

User Syed Mehtab Hassan
by
7.3k points