Algorithm/Programmers
[Programmers] 코딩 기초 트레이닝 #1
j4ko
2023. 11. 25. 01:07
728x90
반응형
목차
대문자로 바꾸기
https://school.programmers.co.kr/learn/courses/30/lessons/181877
def solution(myString):
return myString.upper()
정수 부분
https://school.programmers.co.kr/learn/courses/30/lessons/181850
def solution(flo):
return int(flo)
원소들의 곱과 합
https://school.programmers.co.kr/learn/courses/30/lessons/181929
def solution(num_list):
sum_number = sum(num_list) ** 2
mul = 1
for n in num_list:
mul *= n
return 1 if sum_number > mul else 0
문자열을 정수로 변환하기
https://school.programmers.co.kr/learn/courses/30/lessons/181848
def solution(n_str):
return int(n_str)
특별한 이차원 배열 2
https://school.programmers.co.kr/learn/courses/30/lessons/181831
def solution(arr):
arr_length = len(arr)
flag = 1
for i in range(0, arr_length):
for j in range(0, arr_length):
if arr[i][j] != arr[j][i]:
flag = 0
break
return flag
n개 간격의 원소들
https://school.programmers.co.kr/learn/courses/30/lessons/181888
def solution(num_list, n):
return [num_list[x] for x in range(0, len(num_list), n)]
5명씩
https://school.programmers.co.kr/learn/courses/30/lessons/181886
def solution(names):
answer = []
for x in range(0, len(names), 5):
answer.append(names[x:x + 5][0])
return answer
카운트업
https://school.programmers.co.kr/learn/courses/30/lessons/181920
def solution(start_num, end_num):
return [x for x in range(start_num , end_num+1)]
문자열 붙여서 출력하기
https://school.programmers.co.kr/learn/courses/30/lessons/181946
str1, str2 = input().strip().split(' ')
print(str1+str2)
배열에서 문자열 대소문자 변경하기
https://school.programmers.co.kr/learn/courses/30/lessons/181875
def solution(strArr):
answer = []
for x in range(0, len(strArr)):
if x % 2 == 0:
answer.append(strArr[x].lower())
else:
answer.append(strArr[x].upper())
return answer
728x90
반응형