Apr-03-2023, 02:19 PM
num1
is never going to be == start_list
because num1
is a 'class int(object) instance' and start_list
is a 'class list(object) instance'.So maybe what you're looking to do, is this?
import random start_list = [1, 2] for i in range(4): random_list = [] while len(random_list) < 2: num1 = random.randint(1, 2) random_list.append(num1) if random_list == start_list: print("RL", random_list) else: print("SL", start_list)
Sig:
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein
>>> import this
The UNIX philosophy: "Do one thing, and do it well."
"The danger of computers becoming like humans is not as great as the danger of humans becoming like computers." :~ Konrad Zuse
"Everything should be made as simple as possible, but not simpler." :~ Albert Einstein