알고리즘/코드워 65

[python]Beginner Series#1 School Paperwork

https://www.codewars.com/kata/55f9b48403f6b87a7c0000bd/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 더보기 내 코드 n과 m이 0보다 작을 경우는 0을 return 한다. 그 이외의 경우는 n과 m의 곱한 값을 return 한다. # My Code def paperwork(n, m): return (0 if n

[python]Find the Difference in Age between Oldest and Youngest Family Members

https://www.codewars.com/kata/5720a1cb65a504fdff0003e2/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com (가장 나이가 적은 수, 가장 나이가 많은 수, 둘의 차이)를 출력하는 문제이다. 더보기 내 코드 # My Code def difference_in_ages(ages): youngest_age = min(ages) oldest_age = max(ages) return..

[python]All Star Code Challenge#18

https://www.codewars.com/kata/5865918c6b569962950002a1/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문자열에서 지정한 문자의 개수를 출력하는 문제이다. 더보기 내 코드 count를 이용하면 쉽게 풀 수 있는 문제이다. # My Code def str_count(strng, letter): return strng.count(letter) if __name__=='__..

[python]Will you make it?

https://www.codewars.com/kata/5861d28f124b35723e00005e/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문제 해석(구글 번역) 집에서 멀리 떨어진 친구들과 캠핑을 했지만 돌아갈 시간이 되면 연료가 떨어지고 가장 가까운 펌프가 50 마일 떨어져 있다는 것을 알게 됩니다! 평균적으로 자동차는 갤런 당 약 25 마일로 운행됩니다. 남은 갤런이 2 개 있습니다. 이러한 요소를..

[python]Removing Elements

https://www.codewars.com/kata/5769b3802ae6f8e4890009d2/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 인덱스 짝수 번호인 것 지우는 문제이다. 더보기 내 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # My Code def remove_every_other(my_list): answer = [] for i in range(len(m..

[python]CamelCase Method

https://www.codewars.com/kata/587731fda577b3d1b0001196/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문자열에서 각 단어들의 맨 알파벳을 대문자로 변경 후 스페이스 없애는 문제이다. 더보기 title()이라는 것을 사용하면 각 단어의 첫 글자를 대문자로 변경해준다. replace("old", "new")라는 것을 사용하면 old를 new로 바꾸어준다. 이 두 가지를 ..

[python]Bouncing Balls

https://www.codewars.com/kata/5544c7a5cb454edb3c000047/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 한 아이가 h 높이에서 공을 창문으로 던질 때 공은 h 곱하기 bounce만큼 튀어 오른다. 아이의 엄마가 window에서 볼 때 엄마는 공이 지나가는 것을 몇 번이나 보는지가 문제이다. 더보기 변수 h, bounce와 window가 각 조건을 만족하지 않으면 -1을..

[python]Simple Pig Latin

https://www.codewars.com/kata/520b9d2ad5c005041100000f/train/python Codewars: Train your coding skills Codewars is where developers achieve code mastery through challenge. Train on kata in the dojo and reach your highest potential. www.codewars.com 문자열에서 단어의 앞 알파벳을 단어의 뒤로 옮긴 뒤 'ay'를 덧 붙여서 출력하는 문제이다. 예) 'Pig' -> 'igPay' 더보기 내 코드 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 # My Code def pig_it(text)..

728x90