forked from hofmannol/AlgoDatSoSe25
Fixed problem with mrange
This commit is contained in:
parent
e14a11540c
commit
882310a859
@ -15,9 +15,14 @@ def mrange(parm1, parm2=None, parm3=None):
|
|||||||
stop = int(parm2)
|
stop = int(parm2)
|
||||||
step = int(parm3)
|
step = int(parm3)
|
||||||
num = start
|
num = start
|
||||||
while num < stop:
|
if step > 0:
|
||||||
yield Literal(num)
|
while num < stop:
|
||||||
num += step
|
yield Literal(num)
|
||||||
|
num += step
|
||||||
|
else:
|
||||||
|
while num > stop:
|
||||||
|
yield Literal(num)
|
||||||
|
num += step
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
for l in mrange(10):
|
for l in mrange(10):
|
||||||
|
Loading…
x
Reference in New Issue
Block a user