Week1-1 | 자료형.py

Seongeun·2023년 6월 11일

week1

목록 보기
1/9
post-thumbnail

Week1-1 Python 자료형

  • int: integer(정수) type으로, 메모리가 허용하는 범위까지 정수의 무한자리수를 허용한다.
 int_num = 127678798276349827634213948712693847612893746293746823648

 print(int_num)        #int_num 출력
 print(type(int_num))  #int_num의 type 출력
  • float: real number(실수) type으로, 소수점 17-18번째 자리에서 데이터가 손실된다.
 flot_num = 0.298709870198374019283740192384790128347928437

 print(float_num)        #float_num 출력
 print(type(float_num))  #float_num의 type 출력
  • str: string(문자열) type으로, '' 안에 입력한다.
 str = 'Have a nice day'
 
 print(str)        #str 출력
 print(type(str))  #str의 type 출력
  • bool : True, False를 나타낸다.
 bool = True

 print(bool)        #bool 출력
 print(type(bool))  #bool의 type 출력

0개의 댓글