Jul 15, 2017 04:03 PM
(This post was last modified: Jul 15, 2017 04:06 PM by arkoydas.)
I would like to thank you all for helping me learning python.Here is something I made which asks the user what roll dice wants to take and it prints him the posibillity of it.
This is my progress of 4 weeks almost.I know more things than those ;P
Do you have any suggestions to make it better?
PHP Code
<?php
import itertools,random
def Count_times():
Choice_reversed=Choice[::-1]
for i in All_dice_rolls:
if i==(1,1):
n=0
if i==Choice or i==Choice_reversed:
n+=1
return n
Dice_rolls=[1,2,3,4,5,6]
All_dice_rolls=list(itertools.product(Dice_rolls,range(1,7)))
while 'Hackforums'=='Hackforums':
try:
Choice=((int(input("First dice: ")),(int(input("Second dice: ")))))
break
except:
print("Ooops something went wrong.Please try again..!")
print("{}{}".format(round(Count_times()/len(All_dice_rolls)*100,2),"%"))
Do you have any suggestions to make it better?



![[Image: 0DvFxnA.gif]](https://i.imgur.com/0DvFxnA.gif)