사진찍는 개발자📸👩‍💻
close
프로필 배경
프로필 로고

사진찍는 개발자📸👩‍💻

  • 분류 전체보기 (121)
    • develop (120)
      • PHP (5)
      • Python (73)
      • Back-End Roadmap (1)
      • AWS (36)
      • Java (0)
      • Nest.js (5)
    • interest (1)
      • 35mm film (1)
  • 홈
  • 태그
  • 방명록

[파이썬/Python] 순열(permutation)과 조합(combination)

파이썬의 기본 라이브러리인 itertools를 사용하면 리스트의 조합을 구할 수 있다. from itertools import permutations #순열 from itertools import combinations #조합 1. permutations(순열) -> 하나의 리스트에서 모든 조합 계산 -> 몇 개를 골라 순서를 고려하여 나열한 경우의 수 -> 서로 다른 n개 중 r개를 골라 순서를 정해 나열하는 가짓수 -> 순서를 고려하여 나열하기 때문에 (A, B) 와 (B, A)는 다른 값이 된다. from itertools import permutations array = ['A', 'B', 'C'] result = permutations(array, 2) print(list(result)) # [..

  • format_list_bulleted develop/Python
  • · 2023. 2. 25.
  • textsms
  • navigate_before
  • 1
  • navigate_next
공지사항
전체 카테고리
  • 분류 전체보기 (121)
    • develop (120)
      • PHP (5)
      • Python (73)
      • Back-End Roadmap (1)
      • AWS (36)
      • Java (0)
      • Nest.js (5)
    • interest (1)
      • 35mm film (1)
최근 글
인기 글
최근 댓글
태그
  • #nest swagger 데코레이터
  • #파이썬
  • #swagger 데코레이터
  • #프로그래머스 파이썬
  • #프로그래머스
  • #SAA자격증
  • #nest swagger
  • #SAA
  • #aws
  • #Python
전체 방문자
오늘
어제
전체
Copyright © 쭈미로운 생활 All rights reserved.
Designed by JJuum

티스토리툴바