How can i do this in python? | Sololearn: Learn to code for FREE!
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 ^^

28th Jul 2019, 11:15 PM
Gileade Lima
Gileade Lima - avatar
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")
28th Jul 2019, 11:46 PM
Steven M
Steven M - avatar
+ 1
not work :'(
28th Jul 2019, 11:32 PM
Gileade Lima
Gileade Lima - avatar
0
x=randint(1,101) print(x) if x<=45: print("A") elif 46<=x<=90: print("C") else: print("B")
18th Jul 2022, 11:45 AM
Nisabha Chagika