본문 바로가기

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
  • 경제신문스크랩
  • 랭체인
  • 생성형AI
  • 데이콘경진대회
  • 백준
  • rag
  • Ord
  • AI
  • OpenAI
  • llm
  • 이중리스트
  • listcomprehension
  • chr
  • langchain
  • 파이썬
  • 문자열
  • dict
  • Python
  • 프로그래머스
  • 리스트
more
Archives
Today
Total
관리 메뉴
  • 글쓰기
  • 방명록
  • RSS
  • 관리

목록union (1)

IT 세계의 후아

[python]리스트 합집합/교집합/차집합

set 활용하기!!! a_li = [a, b, c, d]b_li = [b, c, e, f] ※ 합집합list(set(a_li) | set(b_li))== list(set().union(a_li, b_li)) ※ 교집합 ※ 차집합list(set(a_li) - set(b_li)== list(set(a_li).difference(b_li))# 프로그래머스 lv0 글자 지우기# str에서 indices[0,2,6,...] 인덱스 글자들만 빼서 출력하기# 초반 풀이 - 테스트 케이스 에러..def solution(my_string, indices): li = list(set([i for i in range(len(my_string))]).difference(indices))..

Coding/Python 2024. 4. 24. 13:50
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바