आउटपुट निर्धारित करें:
Determine the output :
for i in range(20,30,10) :
j=i/2
print(j)
A)
B)
C)
D)
Explanation:
Let's break down the code:
for i in range(20, 30, 10):
j = i / 2
print(j)
Explanation:
-
range(20, 30, 10)
generates numbers starting from 20, ending before 30, with a step of 10.- This will generate the numbers:
20
and30
, but since the range is exclusive of 30, the loop will only run fori = 20
.
- This will generate the numbers:
-
Inside the loop:
- For
i = 20
,j = i / 2
, soj = 20 / 2 = 10.0
.
- For
-
print(j)
will print10.0
.
Output:
(C) 10.0