개인공부

개인공부/Baekjoon Online Judge

[Python] 2577번

2577번 - 숫자의 개수 ( https://www.acmicpc.net/problem/2577 ) 주석 O # 입력 a = int(input()) b = int(input()) c = int(input()) # a, b, c 를 곱한 값을 배열로 만들기 arr = list(str(a * b * c)) # 0~9 까지 반복 for i in range(10) : # 0~9 까지의 숫자가 몇개 있는지 string으로 변환하여 같은 문자 count print(arr.count(str(i))) 주석 X a = int(input()) b = int(input()) c = int(input()) arr = list(str(a * b * c)) for i in range(10) : print(arr.count(str..

개인공부/Baekjoon Online Judge

[Python] 2480번

2480번 - 주사위 세개 ( https://www.acmicpc.net/problem/2480 ) 주석 O one, two, three = map(int, input().split(" ")) if one == two == three : # 셋 다 같을 때 print(10000 + one * (1000)) elif one == two or one == three : # 두개만 같을 때 print(1000 + one * (100)) elif two == three : print(1000 + three * (100)) else : # 다 다를때 print(100 * max(one, two, three)) 주석 X one, two, three = map(int, input().split(" ")) if one..

개인공부/Baekjoon Online Judge

[Python] 2525번

2525번 - 오븐 시계 ( https://www.acmicpc.net/problem/2525 ) 주석O # 시간을 입력 받는다. # split을 이용해 공백을 기준으로 나눈다. time = input().split(" ") # 공백을 기준으로 나눈 값 n번째를 hour, minute 에 넣는다. hour = int(time[0]) minute = int(time[1]) # 오븐을 돌릴 시간을 입력 받는다. num = int(input()) # minute 에 오븐을 돌릴 시간을 더한다. minute += num # 60 분을 나눈 값을 hour에 더한다. hour += int(minute / 60) # 60 분을 나눈 나머지 값을 minute에 넣는다. minute = int(minute % 60) #..

개인공부/오류 및 에러

[Python] TypeError: 'int' object is not callable

return(sum(args)) 와 같은 무구를 사용했었는데, 위와 같은 오류가 발생했다. 해당 오류는 예약어 sum을 사용함으로써 발생하는 오류라는데 다음과 같이 풀 수 있다. 아무것도 입력되지 않은 창에서 다음과 같이 입력하고 실행한다. del sum 해당 명령어 실행 후에 작성 중이던 코드를 다시 실행해보면 정상적으로 결과가 출력된다.

H E E
'개인공부' 카테고리의 글 목록 (3 Page)