Skip to content

Instantly share code, notes, and snippets.

@agusmakmun
Created January 3, 2018 07:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save agusmakmun/3183a0c72df791656d86f7a8e2b82ee4 to your computer and use it in GitHub Desktop.
Save agusmakmun/3183a0c72df791656d86f7a8e2b82ee4 to your computer and use it in GitHub Desktop.
pakar = ['s', 'w', 'w', 'w', 's', 's', 'w', 's', 'w', 's', 's', 's', 'w', 's', 's', 'w', 's', 'w', 'w', 's', 's', 's', 'w', 's', 's', 'w', 's', 's', 'w', 's', 'w', 's', 'w', 'w', 's', 'w', 's', 'w', 's', 'w', 'w', 'w', 's', 's', 's', 'w', 'w', 's', 's', 'w', 'w', 'w', 's', 's', 'w', 's', 's', 's', 'w', 'w', 'w', 'w', 'w', 's', 's', 'w', 's', 's', 'w', 's', 's', 'w', 's', 'w', 'w', 's', 'w', 's', 's', 's', 's', 'w', 's', 's', 's', 's', 's', 's', 's', 's', 'w', 's', 'w', 'w', 's', 'w', 's', 'w', 'w', 'w', 's', 'w', 's', 's', 'w', 's', 'w', 'w', 'w', 's', 'w', 's', 'w', 's', 's', 'w', 'w', 'w', 's', 's', 'w', 's', 's', 's', 's', 's', 'w', 'w', 'w', 's', 'w', 's', 'w', 'w', 'w', 'w', 's', 's', 't', 't', 't', 't', 't', 't', 't', 'o', 'o', 'o', 't', 'o', 't', 'o', 't', 't', 't', 't', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 't', 't', 'o', 'o', 'o', 't', 't', 't', 't', 'o', 'o', 't', 't', 'o', 'o', 't', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 'o', 't', 'o', 't', 't', 't', 't', 't', 't', 't', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 't', 'o', 'o', 'o', 'o', 't', 't', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 't', 't', 'o', 't', 'o', 't', 't', 't', 'o', 't', 'o', 'o', 't', 'o', 'o', 't', 'o', 'o', 't', 'o', 't', 'o', 'o', 'o', 'o', 't', 'o', 'o', 'o', 'o', 'o', 't', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 't', 'o']
program = ['o', 'w', 'w', 'w', 's', 's', 'w', 's', 'w', 's', 's', 's', 'w', 'o', 's', 'w', 's', 'w', 'w', 's', 's', 'o', 'w', 's', 's', 'w', 's', 's', 'w', 's', 'w', 's', 'w', 'w', 's', 'w', 's', 'w', 's', 'w', 'w', 'w', 's', 's', 's', 'w', 't', 'o', 's', 'w', 'w', 'w', 's', 's', 't', 's', 's', 's', 'w', 'w', 'w', 'w', 'w', 's', 's', 'w', 's', 's', 't', 's', 's', 'w', 's', 'w', 'w', 's', 'w', 'o', 's', 's', 's', 'w', 'o', 'o', 's', 's', 's', 's', 's', 's', 'w', 's', 'w', 'w', 's', 'w', 's', 'w', 'w', 'w', 's', 't', 's', 's', 'w', 's', 'w', 'w', 'w', 'o', 'w', 's', 'w', 's', 's', 'w', 'w', 'w', 's', 's', 'w', 's', 's', 's', 's', 's', 'w', 'w', 't', 's', 'w', 's', 'w', 'w', 'w', 'w', 's', 's', 't', 't', 't', 't', 't', 't', 't', 'o', 'o', 'o', 't', 'o', 't', 'o', 't', 't', 't', 't', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 'o', 't', 't', 'o', 'o', 'o', 't', 't', 't', 't', 'o', 'o', 't', 't', 'o', 'o', 't', 'o', 'o', 't', 't', 't', 's', 'o', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 'o', 't', 'o', 't', 't', 't', 't', 't', 't', 't', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 't', 'o', 'o', 'o', 'o', 't', 't', 'o', 't', 'w', 't', 'o', 'o', 'o', 'o', 'o', 's', 'o', 't', 't', 'o', 't', 'o', 't', 't', 't', 'o', 't', 'o', 'o', 'w', 'o', 'o', 't', 'o', 's', 't', 'o', 't', 'o', 'o', 'o', 'o', 't', 'o', 'o', 'o', 'o', 'o', 't', 'o', 'o', 't', 't', 't', 'o', 'o', 'o', 'o', 't', 'o']
ss = 0
sw = 0
so = 0
st = 0
ws = 0
ww = 0
wo = 0
wt = 0
os = 0
ow = 0
oo = 0
ot = 0
ts = 0
tw = 0
to = 0
tt = 0
for k, v in zip(pakar, program):
if k == 's' and v == 's':
ss += 1
elif k == 's' and v == 'w':
sw += 1
elif k == 's' and v == 'o':
so += 1
elif k == 's' and v == 't':
st += 1
elif k == 'w' and v == 't':
ws += 1
elif k == 'w' and v == 'w':
ww += 1
elif k == 'w' and v == 'o':
wo += 1
elif k == 'w' and v == 't':
wt += 1
elif k == 'o' and v == 's':
os += 1
elif k == 'o' and v == 'w':
ow += 1
elif k == 'o' and v == 'o':
oo += 1
elif k == 'o' and v == 't':
ot += 1
elif k == 't' and v == 's':
ts += 1
elif k == 't' and v == 'w':
tw += 1
elif k == 't' and v == 'o':
to += 1
elif k == 't' and v == 't':
tt += 1
(ss, sw, so, st) # (66, 0, 8, 0)
(ws, ww, wo, wt) # (5, 59, 0, 0)
(os, ow, oo, ot) # (3, 0, 73, 0)
(ts, tw, to, tt) # (0, 2, 0, 60)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment