from itertools import product def probability(dice_number, sides, target): counter=0 pomocnicza=[]
for p in product(list(range(1,sides+1)), repeat=dice_number): pomocnicza.append(p) pomocnicza= [x for x in pomocnicza if sum(x) == target]
counter=len(pomocnicza)
#my_list = [x for x in my_list if x.attribute == value] return round(counter * 1.0 / (sides ** dice_number), 4) if __name__ == '__main__': #These are only used for self-checking and are not necessary for auto-testing def almost_equal(checked, correct, significant_digits=4): precision = 0.1 ** significant_digits return correct - precision < checked < correct + precision
kill yourself fag and start coding in C like a real adult
Adrian Walker
Go ask and put your code inside [code][/code] tags.
Xavier Harris
I will, thanks
Elijah Sullivan
you shouldn't be asking on Sup Forums for help for your school homework. what the fuck is wrong with you.
Xavier Jackson
Do your own homework faggot
Tyler Lewis
Dubs decides what language I learn next
Oliver Ross
...
Aiden Clark
French
Colton Bennett
Chinese
Isaac Robinson
Check'd. Now start studying,
Aiden Bailey
He,asked for dubs, not trips newfag
Ian Richardson
But trips are dubs, just like how squares are rectangles.
Jayden Mitchell
Squares are rectangles because they have 4 sides, dubs is two sequentially repeating digits, trips is 3 , ergo dubs!= trips
Ian Barnes
nice dubs
Oliver Wilson
Dubs aren't trips but trips are dubs
Asher Foster
you mean c# corporations want fast development. No one cares about memory these days. And c is now used mainly, for games, hardware, drivers and IOT devices.
Eli Martinez
What about languages like R or julia?
Aaron Evans
R is made for scientists. it is god awful. it is slow and memory intensive because all the library's where written by people that had no clue how to write efficient programs.
Gavin Miller
So what would you recommend to crunch and visualize data?
Nolan Parker
python. You can use R just don't build applications with it that your entire company will use.
Eli Garcia
/thread
Luis Richardson
>he fell for a meme language
Leo Perry
Why is everyone else itt saying not to use python?
Ian Flores
HolyC
Isaiah Cox
because they think it's not a programming language. Sure it isn't as fast as the other languages, but you can create your stuff faster in it. The 2 main languages used for number crunching today are R and python.
Other languages will be more efficient, but your time is also important, it will take you at least 4 times as long in other languages to program your program and set everything up.
If you have infinite time, you can create something from scratch, but if your time is important and hardware isn't a limiting factor use R or python