Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren- 1
How can i do this in python?
I would like to know how I can make the probability of a card coming out, for example: I have a letter A, letter B and letter C but letter B is more "rare" and it is harder to pick up like the others..and I want to do this in python..machines give me 1 of 3, and B has to be the hardest if you catch it..I hope you will help me in this and thanks for the attention ^^
3 Antworten
+ 4
Similar to Jay Matthews :
from random import randint
x=randint(1,101)
print(x)
if x<=45:
print("A")
elif 46<=x<=90:
print("C")
else:
print("B")
+ 1
not work :'(
0
x=randint(1,101)
print(x)
if x<=45:
print("A")
elif 46<=x<=90:
print("C")
else:
print("B")