본문 바로가기

IT 세계의 후아

검색하기
IT 세계의 후아
프로필사진 후__아

  • 전체 (55)
    • Coding (43)
      • Python (27)
      • Study (15)
      • Algorithm (1)
    • Recording (12)
      • NewsScrap (10)
      • 취준기록 (0)
      • Etc (2)
Guestbook
Notice
Recent Posts
Recent Comments
Link
«   2025/05   »
일 월 화 수 목 금 토
1 2 3
4 5 6 7 8 9 10
11 12 13 14 15 16 17
18 19 20 21 22 23 24
25 26 27 28 29 30 31
Tags
  • chr
  • llm
  • 백준
  • 생성형AI
  • 이중리스트
  • 리스트
  • AI
  • listcomprehension
  • 데이콘경진대회
  • 파이썬
  • Python
  • 프로그래머스
  • 랭체인
  • rag
  • OpenAI
  • Ord
  • 문자열
  • langchain
  • dict
  • 경제신문스크랩
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록GCD (1)

IT 세계의 후아

[python]두 리스트 공통 인자 추출(최대공약수/최소공배수)

※ List Comprehension리스트 a, b[x for x in a if x in b]  # a의 인자 중 b에도 있는 인자만 추출 #프로그래머스 lv1 최대공약수, 최소공배수#n, m 두 숫자를 받으면 [gcd, lcm] returndef divide(num): # num의 약수 리스트 return div_li = [] for i in range(1, int(num**(1/2))+1): if num%i == 0: div_li.append(i) if i != num//i: div_li.append(num//i) return div_lidef solution(n, m): answer = [] i..

Coding/Python 2024. 6. 15. 00:10
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바