#입력함수
var = input()
print(var)

#(자료)형 변환
# int() 정수
# float() 실수
# str() 문자열
# list() 리스트
print(int('123'))

#비교연산
# == 같다
# != 같지 않다
# > 크다
# < 작다
# >= 크거나 같다
# <= 작거나 같다
#참과 거짓을 판단하기 위해

print(3>5)
print(5>2)

result1 = 3 > 1
result2 = 6 < 2
print(result1, result2)

#논리연산
#and는 둘 다 참이여야 참이다.
#or은 둘 중 하나라도 참이라면 참이다.
#not은 둘 다 거짓이여야 참이다.

print(6>2 and 3>5 and 5==5)
print(3>1 or 10<2 or 5>2)
print((not 6<3) and (not 4<2))

#조건문 (if문)
i = int(input())
if i==0:
    print(i)
else:
    print("알맞은 숫자가 아닙니다.")
    
#여러 조건에 작동하는 조건문
if i==0:
    print("0")
elif i==1:
    print("1")
elif i==2:
    print("2")
else:
    print("숫자가 아닙니다.")

# 문제) 점수를 입력받고 그 점수가 90점 이상인 경우 A, 90점미만 70점 이상인 경우 B,
#       70점미만 50점 이상인 경우 c, 그 외의 경우를 F라고 출력하시오.

score = int(input())
if score >= 90:
    print("A")
elif score < 90 and score >= 70:
    print("B")
elif score < 70 and score >= 50:
    print("C")
else:
    print("F")


Embed on website

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