4-Module-1 - Python Programming Fundamentals-04-01-2024
4-Module-1 - Python Programming Fundamentals-04-01-2024
Output:
0123456789
Current Letter : P
Current Letter : y
Current Letter : t
Current Letter : h
Current Letter : o
Current Letter : n
For and Range
for n in range(1, 6):
print(n)
When the above code is executed:
1
2
3
4
5
range function call
Syntax - range( begin,end,step )
where
Begin - first value in the range; if omitted, then default value
is 0
end - one past the last value in the range; end value may not
be omitted
Step - amount to increment or decrement; if this parameter
is omitted, it defaults to 1 and counts up by ones
Output:
2
4
6
8
Predict output of above code?