
01. 입출력과 사칙연산

a,b = map(int, input().split())
print(a+b)
map(function, iterable)
: map(정수,리스트)을 사용해 정수로 변환

x = input().split() # input().split()의 결과는 문자열 리스트
m = map(int, x) # 리스트의 요소를 int로 변환, 결과는 맵 객체
a, b = m # 맵 객체는 변수 여러 개에 저장할 수 있음
split ( ) 함수
문자열.split()
: 문자열을 일정한 규칙으로 잘라서 리스트로 만들어 주는 함수
문자열.split()
문자열.split('구분자')
문자열.split('구분자', 분할횟수)
문자열.split(sep='구분자', maxsplit=분할횟수)
^ 가장 정확
사칙연산
a,b=map(int,input().split())
print(a+b)
print(a-b)
print(a*b)
print(int(a/b))
print(a%b)


map(int,input().split( )) 사용
a_list=[1,1,2,2,2,8]
b,c,d,e,f,g=map(int,input().split())
print(1-b,1-c,2-d,2-e,2-f,8-g)

a=int(input()) # 입력받은 값을 int(정수)로 변환
b=input() # input()으로 받은 숫자=문자열
print(a*int(b[2])) # b = '472'
print(a*int(b[1]))
print(a*int(b[0]))
print(a*int(b[2])+a*int(b[1])*10+a*int(b[0])*100)
02. 조건문

h,m = map(int, input().split())
t = int(input())
a=m+t
if(a>=60):
b = a%60
c = (a-b)/60
if(h>=23):
print(int(c-1),int(b))
else:
print(int(h+c),int(b))
else:
print(h,a)
03. 반복문

count = int(input())
k=0
for _ in range(count):
k += 1
a,b = map(int,input().split())
print(f'Case #{k}: {a+b}')
마지막 print문에 f-strint말고 일반문으로 써봤는데 계속 오류가 났었다.
뭐가 다른거지? print문에 단어랑 단어 사이에 +랑 ,의 다른점이 궁금하다.

n,x=map(int,input().split())
# n=str(n)
# x=str(x)
a= input().split()
b=[]
for i in a:
i = int(i)
if i < x:
b.append(i)
for j in b:
j=str(j)
print(j, end=" ")

a, b = map(int, input().split())
while a!=0 and b!=0:
print(a+b)
a, b = map(int, input().split())
while문
: while문의 조건 만족시 while문 안의 내용을 실행
이것을 까먹고 계속 while a==0 and b==0으로 써서 실행이 되지 않았다.

while True:
try:
a, b = map(int, input().split())
print(a+b)
except EOFError:
break