3 תשובות
שואל השאלה:
אני גם יודע בגאווה אבל הוא רוצה פייתון ואני לא מצליח אבל תודה בכל זאת
אני גם יודע בגאווה אבל הוא רוצה פייתון ואני לא מצליח אבל תודה בכל זאת
אנונימי
import random
x = int(input('input number: '))
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
for i in range(x):
y = random.randint(1, 6)
if y == 1:
x1 += 1
elif y == 2:
x2 += 1
elif y == 3:
x3 += 1
elif y == 4:
x4 += 1
elif y == 5:
x5 += 1
else:
x6 += 1
print(f'amount of times that each one of the possible results was done:\n1: {x1}\n2: {x2}\n3: {x3}\n4: {x4}\n5: {x5}\n6: {x6}')
תתעלם מהאינדטציה הנוראית של סטיפס, זה פשוט סטיפס לא נותן לעשות אינדטציה
x = int(input('input number: '))
x1 = 0
x2 = 0
x3 = 0
x4 = 0
x5 = 0
x6 = 0
for i in range(x):
y = random.randint(1, 6)
if y == 1:
x1 += 1
elif y == 2:
x2 += 1
elif y == 3:
x3 += 1
elif y == 4:
x4 += 1
elif y == 5:
x5 += 1
else:
x6 += 1
print(f'amount of times that each one of the possible results was done:\n1: {x1}\n2: {x2}\n3: {x3}\n4: {x4}\n5: {x5}\n6: {x6}')
תתעלם מהאינדטציה הנוראית של סטיפס, זה פשוט סטיפס לא נותן לעשות אינדטציה
באותו הנושא: