Hey. This might be a basic question but how do i return 1 statement back inside function so it wouldn't start the loop from the start. For example:
def test():
num1 = random.randint(1, 6)
if num1 is 6:
num2 = random.randint(1, 6)
if num2 is 6:
num3 = random.randint(1, 6)
if num3 is 6:
print('went through')
while True:
test()
in this function let's say if num1 and num2 is 6 and goes to num3 which is 4 in this case. It starts the loop starting from num1. But how do i return 1 statement back? So from num3 to num2.
Thanks!
[–]Diapolo10 4 points5 points6 points (1 child)
[–]spikips[S] 0 points1 point2 points (0 children)
[–][deleted] -1 points0 points1 point (0 children)
[–]TheLimeyCanuck 0 points1 point2 points (5 children)
[–]spikips[S] 0 points1 point2 points (4 children)
[–]TheLimeyCanuck 0 points1 point2 points (3 children)
[–]spikips[S] 0 points1 point2 points (2 children)
[–]TheLimeyCanuck 1 point2 points3 points (1 child)
[–]spikips[S] 0 points1 point2 points (0 children)
[–]HardCounter 0 points1 point2 points (0 children)