Mar-24-2020, 06:54 PM
I think I understand what you want your program to do. But I am not 100% sure.
Actually, I think your program may be working fine. What is confusing could be a lot of prints.
In each loop, there is:
Actually, I think your program may be working fine. What is confusing could be a lot of prints.
In each loop, there is:
print(copy) # previous number number = random.randint(1, mnum) print(number) # current numberSo you need to check result in pairs, example:
Output:(first iteration)
2
1
(second iteration)
1
2
(third iteration)
2
2
(two in a row).
Maybe try printing like this:# ... code before while tryes < repeats : copy = number print("previous number: ", copy) number = random.randint(1, mnum) print("current number: ", number) print("-------") # code after ...Did this help? Please clarify more if I didn't answer your question.