Apr-03-2023, 02:46 PM
(Apr-03-2023, 02:33 PM)Frankduc Wrote: Is it more clear?
Yes; that's clearer.
Is this closer?
import random start_list = [1, 2] for i in range(40): random_list = [] while len(random_list) < 4: num1 = random.randint(1, 4) random_list.append(num1) check = random_list[0:2] if check == start_list: print("Found") print("RL", random_list) print()
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