# subcribe to my channel
# https://www.youtube.com/channel/UCakNP54ab_3Qm8MPdlG4Zag
def own_range(start=0, end=0, step=1):
if step == 0:
raise ValueError("own_range() arg 3 must be not zero")
if start > end and step < 0:
while start > end:
yield start
start += step
elif start > end or (start != 0 or end == 0) and start != 0 and end == 0:
while end < start:
yield end
end += step
elif start == 0 and end != 0 and end > 0 and step > 0 or (start != 0 or end == 0) and start != 0 and start < end and step > 0:
while start < end:
yield start
start += step
#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
range(start:optional, stop:required, step:optional)
A built-in python function to create a sequence of integers.
range(10) #[0 to 9]
range[2,9] #start 2 and stop 10
print(list(range(10))) #change create range object into list.
range(1,100,10)
# if numbers are same in the range function then,
# the range function outputs empty range
# this is because, there are no integers b/w n and n
for i in range(1,1):
print("runs")
# prints nothing
arr_data=[1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20]
user = int(input("Enter the product of numbers: "))
for i in range(0,20,1):
a = arr_data[i]
for t in range(0,20,1):
b = arr_data[t]
if (a*b) == user:
print(a,"x",b,"=",user)
else:
pass