본문 바로가기

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

목록자료형 (1)

IT 세계의 후아

[python]bool 자료형/함수, 논리연산자

※ boolean bool 자료형 True, False ※ bool 함수 bool(값이 있는 변수) == True int(bool(True))) == 1 # 백준 2753 a = int(input()) if a % 4 == 0: if a % 100 == 0: if a % 400 == 0: print(1) else: print(0) else: print(1) else: print(0) # bool a = int(input()) print(int((not a % 4) and (a % 100 or not a % 400))) # 프로그래머스 n의 배수 def solution(num, n): return 1 if num % n == 0 else 0 # 다른 풀이 # return int(num % n == 0) #..

Coding/Python 2024. 3. 14. 16:09
이전 Prev 1 Next 다음

Blog is powered by kakao / Designed by Tistory

티스토리툴바