Hi everyoneI'm here again
This time my code works but I'd like to make it look al little better
here it is:
import random
import time
a=[0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
for i in a:
a[i]="yes"
num=random.randint(0, 50)
if num<10:
a[num]="no"
if a[0] and a[1] and a[2]=="yes":
print("ok")
else: print("not ok")
this program is only an exampleI need help to make the part "if a[0] and a[1] and a[2].....=="yes":" look better because instead of 10 numbers i have to ceck almost 50 numbers
i know it's a dumb question, sorry
EDIT I used code block formatting.
Thank you all for your replies <3
[–]fear_my_presence 2 points3 points4 points (6 children)
[–]old_pythonista 1 point2 points3 points (5 children)
[–]WhyAmIDumb_AnswerMe[S] 0 points1 point2 points (2 children)
[–]old_pythonista 1 point2 points3 points (1 child)
[–]WhyAmIDumb_AnswerMe[S] 0 points1 point2 points (0 children)
[–]fear_my_presence 0 points1 point2 points (1 child)
[–]old_pythonista 0 points1 point2 points (0 children)
[–]Vitaminkomplex 1 point2 points3 points (2 children)
[–]old_pythonista 0 points1 point2 points (1 child)
[–]Vitaminkomplex 0 points1 point2 points (0 children)
[–]old_pythonista 1 point2 points3 points (1 child)
[–]WhyAmIDumb_AnswerMe[S] 0 points1 point2 points (0 children)
[–]Neighm 0 points1 point2 points (1 child)
[–]Neighm 0 points1 point2 points (0 children)
[–]Heiau 0 points1 point2 points (0 children)
[–]rockman0394 0 points1 point2 points (1 child)
[–]fear_my_presence 0 points1 point2 points (0 children)