[파이썬] 007_모듈 (기초) ⭐️

Soo·2023년 8월 6일
0

✏️ operator.

💡 산술 연산자

  • + : operator.add ( )
  • - : operator.sub ( )
  • * : operator.mul ( )
  • / : operator.truediv ( )
  • % : operator.mod ( )
  • // : operator.floordiv ( )
  • ** : operator.pow ( )

💡 비교 연산자

  • == : operator.eq ( )
  • != : operator.ne ( )
  • > : operator.gt ( )
  • >= : operator.ge ( )
  • < : operator.lt ( )
  • <= : operator.le ( )

💡 논리 연산자

  • and : operator.and_( )
  • or : operator.or_( )
  • not : operator.not_( )

✏️ math.

  • 절대값 : math.fabs ( )
  • 올림(1의 자리로) : math.ceil ( )
  • 내림 : math.floor ( )
  • 버림 : math.grunc ( )
  • a와 b의 최대공약수 : math.gcd (a, b)
  • 팩토리얼 : math.factorial ( )

✏️ random.

  • a~b 중 난수 1 개 : random.randint (a,b)
  • a~b 중 난수 n 개 : random.sample (range(a,b), n)
    • 리스트 형식으로 출력 [a, b, c, d, ]
    • 1~10일 경우 : range(1,11)
  • 뒤죽박죽 섞어서 추출 : random.shuffle (변수)

✏️ time.

  • 로컬 타입 : time.localtime ()
  • 연: time.localtime.tm_year
  • 월 : time.localtime.tm_mon
  • 일자 : time.localtime.tm_mday
  • 시간 : time.localtime.tm_hour
  • 분 : time.localtime.tm_minute
  • 초 : time.localtime.tm_second
  • 요일 : time.localtime.tm_wday
    • 요일도 숫자로 표기

[ 수강 강의 : 제로베이스 데이터 취업 스쿨 ]

profile
데린이인데요 ໒꒰ྀ ˶ • ༝ •˶ ꒱ྀིა (잘못 된 부분은 너그러이 알려주세요.)

0개의 댓글

관련 채용 정보