Answers for "range(n) python"

2

range() python

#can be used a sequence of numbers
x = range(6)
print(x)
#Outputs 0 1 2 3 4 5

for i in range(start,finish ,step) 
#gives range of numbers
#start is optional default is 0
#finish needed specifying when to stop
#step is incremetntaition of jump also optional
Posted by: Guest on January-14-2021
2

for i in range python

for i in range(start, end):
  expression
Posted by: Guest on October-07-2020
3

iteration

#itration 
a,b=4,5
for i in [1,2]:
    print(a,b,i)
    a+=1
    b-=1
#output:
4 5 1
5 4 2
Posted by: Guest on December-10-2021

Python Answers by Framework

Browse Popular Code Answers by Language