-
[프로그래머스] 문자 반복 출력하기 - python코딩테스트 2023. 12. 13. 23:11
https://school.programmers.co.kr/learn/courses/30/lessons/120825
프로그래머스
코드 중심의 개발자 채용. 스택 기반의 포지션 매칭. 프로그래머스의 개발자 맞춤형 프로필을 등록하고, 나와 기술 궁합이 잘 맞는 기업들을 매칭 받으세요.
programmers.co.kr

def solution(my_string, n): answer = '' for i in my_string: answer += (i*n) return answerdef solution(my_string, n): return ''.join(i*n for i in my_string)https://1ooflower.tistory.com/68
[PYTHON] 리스트를 문자열로 합치기- join()
join() : 리스트나 튜플과 같은 iterable 객체의 요소들을 문자열로 결합 a_list = ['a', 'b', 'c'] result = ' '.join(a_list) #공백으로 구분된 문자열로 print(result) #a b c type(result) #문자열타입 a b c str a_list = ['a', '
1ooflower.tistory.com
'코딩테스트' 카테고리의 다른 글
[프로그래머스] 양꼬치 - python (0) 2023.12.13 [프로그래머스] 특정 문자 제거하기 - python (0) 2023.12.13 [프로그래머스] 짝수 홀수 개수- python (0) 2023.12.13 [프로그래머스] 직각삼각형 출력하기 - python (0) 2023.12.13 [프로그래머스] 문자열 뒤집기 - python (0) 2023.12.11