Name: xpoferens 2009-03-28 0:47
These tutorials make me do such basic shit, so I decided to do my own thing and copy some built in functions. Here's my first attempt at a range function. From lurking around here I've learnt that there are many ways to do the same thing, and some ways are more efficient than others. Am I doing this the complete noob way? Is there a more efficient way?
def myrange(a, b, c):
while True:
if b == 0:
print('incorrect b value')
break
else:
i = a
a += b
if abs(a) > abs(c + b):
break
else:
print(i)
continue
print(a)
myrange(1, 1, 10)
#Im pretty proud of my work, considering the time I have been programming, but I want to learn to be better, so any constructive criticism is welcome. If you guys want me to stop posting n00b programs tell me and I will stop.
def myrange(a, b, c):
while True:
if b == 0:
print('incorrect b value')
break
else:
i = a
a += b
if abs(a) > abs(c + b):
break
else:
print(i)
continue
print(a)
myrange(1, 1, 10)
#Im pretty proud of my work, considering the time I have been programming, but I want to learn to be better, so any constructive criticism is welcome. If you guys want me to stop posting n00b programs tell me and I will stop.