현지
Home
  • 전체
    • CT
      • SWEA
      • 백준
      • 프로그래머스
    • CS
      • 알고리즘
      • 자료구조
      • Python
      • JAVA
      • SQL
      • 웹개발
    • 실습
      • 프로젝트
      • Brity RPA
      • Outsystems
    • 일상
Home
  • 전체
    • CT
      • SWEA
      • 백준
      • 프로그래머스
    • CS
      • 알고리즘
      • 자료구조
      • Python
      • JAVA
      • SQL
      • 웹개발
    • 실습
      • 프로젝트
      • Brity RPA
      • Outsystems
    • 일상
블로그 내 검색
GITHUB

현지

현지의 개발일지

CS/Python (2)

  • CS/Python

    [Python] itertools 라이브러리

    from itertools import * 1. 순열 ▪ permutations 구성 요소가 같더라도 순서가 다르면 나열 중복이 없는 모든 경우의 수 나열 from itertools import permutations data = [ 1, 2, 3 ] list(permutations(data, 2) [(1, 2), (1, 3), (2, 1), (2, 3), (3, 1), (3, 2)] list(permutations(data, 2) [(1, 2, 3), (1, 3, 2), (2, 1, 3), (2, 3, 1), (3, 1, 2), (3, 2, 1)] 2. 중복 순열 순열에서 같은 요소를 상관없이 중복 포함하여 모두 나열 from itertools import * data = [ 1, 2, 3 ] list..

    2023. 7. 1.

  • CS/Python

    [Python] math라이브러리

    1. 팩토리얼(factorial) ▪ math.factorial() import math math.factorial(3) 6 math.factorial(10) 3628800 2. 제곱근 ▪ math.sqrt() import math print(math.sqrt(25)) 5.0 print(int(math.sqrt(36))) 6 2-1) 약수구하기 import math n = 10 x = [] for i in range(1, int(math.sqrt(n)) + 1): if n % i == 0: x.append(i) if i != n // i: x.append(n // i) x.sort() x [1, 2, 5, 10] 3. 최대 공약수 ▪ math.gcd() import math math.gcd(3,6) 3 ..

    2023. 7. 1.

이전
1
다음
전체 글 보기
  • GITHUB
Tistory 로그인
Tistory 로그아웃
로그아웃 글쓰기 관리

Today

Total

Designed by Nana
블로그 이미지
hyunji1109

티스토리툴바