import randomdata = random.sample(range(0, 10), 3)for i in range(10): getData = list(map(int, input('숫자를 입력해 주세요: ').split())) if getData == data: print("3 strike!(Win!)") break elif getData[:2] == data[:2] or getData[1:] == data[1:] or (getData[0] == data[0] and getData[2] == data[2]): print("2 strike") elif getData[0] == data[0] or getData[1] == data[1] or getData[2] == data[2]: x = 0 for j in range(3): if getData[j] in data: x += 1 if x == 2: print("1 strike, 1 Ball") elif x == 3: print("1 strike, 2 Ball") else: print("1 strike") else: x = 0 for j in range(3): if getData[j] in data: x += 1 if x == 1: print("1 Ball") elif x == 2: print("2 Ball") elif x == 3: print("3 Ball") else: print("out")
top of page
bottom of page