Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- count = 0
- f = open('test.txt', 'w')
- for i in [x+1 for x in range(6)]:
- for j in [x+1 for x in range(6)]:
- if (i==1 and j==4) or (i==6 and j==4) or (i==4 and j==1) or (i==4 and j==6):
- f.write('+')
- f.write(str(i) + ' ' + str(j) + '\n')
- count += float(1)/36
- else:
- for k in [x+1 for x in range(6)]:
- if i==4 or j==4:
- if k==1 or k==6:
- f.write('+')
- count += float(1)/216
- f.write(str(i) + ' ' + str(j) + ' ' + str(k) + '\n')
- else:
- for l in [x+1 for x in range(6)]:
- if (k==1 and l==4) or (k==6 and l==4) or (k==4 and l==1) or (k==4 and l==6):
- f.write('+')
- count += float(1)/1296
- f.write(str(i) + ' ' + str(j) + ' ' + str(k) + ' ' + str(l) + '\n')
- print count
- f.close()
Advertisement
Add Comment
Please, Sign In to add comment