number_list = list(map(int, input().split()))
프로그램 종료 함수
예외상황 빼두고 exit()로 종료 시키기도 가능
Python 내장 함수로 객체 주소 return 함수
Python 내장 함수로 객체 타입 출력 함수
while True :
try:
A, B = map(int, input().split())
print(A+B)
except:
break
try:
while True:
A, B = map(int, input().split())
print(A+B)
except:
print("error")
break
number = int(input())
for multipleNumber in range(1, 10):
printNum = int(number * multipleNumber)
print(number, "*", multipleNumber, "=", printNum)
'''
실행결과
2
2 * 1 = 2
2 * 2 = 4
2 * 3 = 6
2 * 4 = 8
2 * 5 = 10
2 * 6 = 12
2 * 7 = 14
2 * 8 = 16
2 * 9 = 18
'''
testCaseT = int(input())
for testCase in range(1, testCaseT+1):
A, B = map(int, input().split())
print("Case #%d: %s" %(testCase, A+B))
print("%.3f"%aboveAverageStudentRate+"%")
# 40.000%
a, b = map(int, input().split())
import sys
testCaseT = int(input())
for testCase in range(testCaseT):
A, B = map(int, sys.stdin.readline().rstrip().split())
print(A+B)
input 대신 sys.stdin.readline을 사용할 수 있다.
단, 이때는 맨 끝의 개행문자까지 같이 입력받기 때문에 문자열을 저장하고 싶을 경우 .rstrip()을 추가로 해 주는 것이 좋다.
N = int(input())
for i in range(N, 0, -1):
print(i)