2.파이썬의 깁ㄴ자료형 10216
Python
# 자료형 데이터의 종류
# 데이터의 자료형을 확인하는 함수 : type()
print("-------------1-------------")
# 1. 숫자로 이루어진 자료형
# 정수를 나타내는 자료형 : int
print(18)
print(type(18))
# 실수를 나타내는 자료형 float
print(18.18)
print(type(18.18181818))
print("-------------2-------------")
# 2. 문자로 이루어진 자료형 str
print('고양이소릴내봐묘묘묘묘묘')
print(type("sibal"))
print("-------------3-------------")
# 3. 참(True) 또는 거짓(False)을 나타내는 자료형 bool
print(3<5)
print(type(3>5))
print("-------------4-------------")
# 4. 여러개의 원소(데이터)로 이루어진 자료형 list
print([1,2,3,"야",15.34])
print(type([1,2,3,"야",15.34]))
print('\n----- 문제1 -----')
# 자신의 나이를 정수형으로 입력하고 출력해보자
print(17)
# 자신의 이름을 문자열로 입력하고 출력해보자
print('이서연')
# 자신의 나이와 이름을 리스트로 입력하고 출력해보자
print([17,'이서연'])
Output
Embed on website
To embed this program on your website, copy the following code and paste it into your website's HTML:
Comments
This comment belongs to a banned user and is only visible to admins.
This comment belongs to a deleted user and is only visible to admins.