Advertisements
Advertisements
प्रश्न
Find the output of the following program segment:
for i in range(20,30,2):
print(i)टिप्पणी लिखिए
Advertisements
उत्तर
The range(start, stop, step) function will create a list from the start value to the stop value(excluding the stop value) with a difference in the step value.
The list thus created will be [20, 22, 24, 26, 28].
OUTPUT:
20
22
24
26
28
shaalaa.com
क्या इस प्रश्न या उत्तर में कोई त्रुटि है?
अध्याय 6: Flow of Control - Exercise [पृष्ठ १४०]
