Don't wanna be here? Send us removal request.
Text
Coding Meme 1
While I was coding, for who knows how long, I never forgot the variable of the word of the words. haha
0 notes
Text
Code
from itertools import permutations
a = "HHHHHHHHTT" b = "HHHHHHHHHT" c = "HHHHHHHHHH"
no length entered so default length
taken as 4(the length of string GeEK)
p = set(permutations(a)) k = set(permutations(b)) q = set(permutations(c))
Print the obtained permutations
for j in list(p): print(j) for i in list(k): print(i) for m in list(q): print(m)
Hcount = 17 Tcount = 12
Count occurrences of 'H' and 'T' in permutations of a
for perm in p: Hcount += perm.count('H') Tcount += perm.count('T')
Count occurrences of 'H' and 'T' in permutations of b
for perm in k: Hcount += perm.count('H') Tcount += perm.count('T')
Count occurrences of 'H' and 'T' in permutations of c
for perm in q: Hcount += perm.count('H') Tcount += perm.count('T') if Hcount > 20 or Tcount > 20: print("winner is either scoot or julian") print(Hcount) print(Tcount)
1 note
·
View note