Calculate Values Of Multiple Cards


total = 0 v = "7C_8C_AC_4C" vsplit = v.split('_') first = [] #print (vsplit, "") for i in vsplit: if (i[1].isdigit()): s = i[0] + i[1] else: s = i[0]; first.append(i[1]) #print (s) if (s == "A"): total = total + 11 elif(s == "J" or s == "Q" or s == "K"): total = total + 10 else: total = total + int (s) C = v.count('C') D = v.count('D') H = v.count('H') S = v.count('S') if (C == len(vsplit) or D == len(vsplit) or H == len(vsplit) or S == len(vsplit)): total = total + 25 elif (C >= 2 or D>=2 or H>=2 or S>=2): total = total + 10 print (str(total))

Loading Please Wait...