Simple_PS

  • Lv0 프로그래머스(Programmers)[Python][파이썬] rny_string
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/181863 """ # 풀이 과정 def solution(rny_string): x=rny_string.replace("m","rn") return x
  • Lv0 프로그래머스(Programmers)[Python][파이썬] qr코드
    """ 출처:프로그래머스 https://school.programmers.co.kr/learn/courses/30/lessons/181903 """ # 풀이 과정 def solution(q, r, code): return code[r::q]
  • Lv0 프로그래머스(Programmers)[Python][파이썬] ox퀴즈
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/120907 """ 풀이 과정 def solution(quiz): return ["O" if x else "X" for x in map(eval, map(lambda x: x.replace("=", "=="), quiz))]
  • Lv0 프로그래머스(Programmers)[Python][파이썬] n의 배수 고르기
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/120905 """ # 풀이 과정 def solution(n, numlist): answer = [] for x in numlist: if x % n == 0: answer.append(x) return answer # 풀이 과정2 def solution(n, numlist): answer = [] for x in numlist: if x%n==0: answer.append(x) else:continue return answer
  • Lv0 프로그래머스(Programmers)[Python][파이썬] n보다 커질때까지 더하기
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/181884 """ # 풀이 과정 def solution(numbers, n): count=0 for x in numbers: count+=x if count>n: return count
  • Lv0 프로그래머스(Programmers)[Python][파이썬] n번째 원소부터
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/181892 """ # 풀이 과정 def solution(num_list, n): x = num_list[n - 1:]
  • Lv0 프로그래머스(Programmers)[Python][파이썬] n번째 원소까지
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/181889 """ # 풀이 과정 def solution(num_list, n): x = num_list[:n] answer = x return answer
  • Lv0 프로그래머스(Programmers)[Python][파이썬] n개 간격의 원소들
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/181888 """ # 풀이 과정 def solution(num_list, n): x=num_list[::n] answer = x return answer
  • Lv0 프로그래머스(Programmers)[Python][파이썬] k의 개수
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/120887 """ # 풀이 과정1 def solution(i, j, k): answer = 0 num = [] for x in range(i, j + 1): num.append(str(x)) a = "".join(num) return a.count(str(k)) # 풀이 과정2 def solution(i, j, k): answer = sum([ str(i).count(str(k)) for i in range(i,j+1)]) return answer
  • Lv0 프로그래머스(Programmers)[Python][파이썬] A로 B만들기
    """ 출처: 프로그래머스 코딩 테스트 연습, https://school.programmers.co.kr/learn/courses/30/lessons/120886 """ # 풀이 과정1 def solution(before, after): result = 0 if len(before) == len(after): for a in range(len(before)): if before.count(before[a]) == after.count(before[a]): result += 1 continue else: return 0 return 1 # 풀이 과정2 def solution(before, after): before=sorted(before) after=sorted(after) if before==after: return 1 else: return 0
  • << 19 20 21 22 23 24 25 >>