3 #정수형
3.1 #실수형
'hello' #문자열
[1, 2, 3] #리스트
print(1+2) #더하기
print(2-1) #빼기
print(2*1) #곱하기
print(2/1) #나누기
print(2%1) #나머지
list = ['a', 'p', 'p', 'l', 'e']
print(list[0]) #일부만 꺼내는 인덱싱
print(list) #전체 리스트 출력
print(list[1:3]) #슬라이싱
#비교연산
print(10>1) #크다
print(1<10) #작다
print(5>=3) #크거나 같다
print(3<=5) #작거나 같다
print(1!=2) #다르다
print(1==1) #같다
#논리연산
print(10>1 and 1<10) #둘 다 참이여야 참
print(10>1 or 1!=1) #둘 중 하나만 참이여도 참
print(not 5>=3) #원래의 값을 반대로 바꿈
#입력받기
'''
n = input()
#형 변환
n1 = int(input()) #정수형으로 변환
n2 = float(input()) #실수형으로 변환
n3 = str(input()) #문자열로 변환
n4 = list(input()) #리스트로 변환
'''
i = 0 #조건문
if i < 3:
    print('hello')
elif i == 3:
    print('world')
else:
    print('!!')
student_age = int(input())
if 8 <= student_age and 13 >= student_age:
    print("초등학생입니다.")
elif 14 <= student_age and 16 >= student_age:
    print("중학생입니다.")
elif 17 <= student_age and 19 >= student_age:
    print("고등학생입니다.")
else:
    print("학생이 아닙니다.")

Embed on website

To embed this project on your website, copy the following code and paste it into your website's HTML: