
from itertools import combinations
import math
def is_prime(n):
if n<2:
return False
for i in range(2, int(math.sqrt(n))+1):
if n%i ==0:
return False
return True
def solution(numbs):
number=0
for a,b,c in combinations(numbs,3):
if is_prime(a+b+c) == True:
number+=1
else:
continue
return number'파이썬 > 백준' 카테고리의 다른 글
| 프로그래머스 카드 뭉치 파이썬 (0) | 2023.07.24 |
|---|---|
| 프로그래머스 | 달리기 경주 (python) (0) | 2023.07.13 |
| python ) 백준 #1541 잃어버린 괄호 (0) | 2022.10.17 |
| 백준 2217번 : 로프 (0) | 2022.10.15 |
| 백준 1789번 : 수들의 합 (1) | 2022.10.15 |