본문 바로가기

Python345

The Office I - Outed Description: Your colleagues have been looking over you shoulder. When you should have been doing your boring real job, you've been using the work computers to smash in endless hours of codewars. In a team meeting, a terrible, awful person declares to the group that you aren't working. You're in trouble. You quickly have to gauge the feeling in the room to decide whether or not you should gather.. 2022. 4. 24.
Shortest Word Description: Simple, given a string of words, return the length of the shortest word(s). String will never be empty and you do not need to account for different data types. Solution: 1. Count the number of letters in each word. 2. Returns the smallest number of characters. def find_short(s): return min(list(map(len, s.split()))) 2022. 4. 23.
Vowel Count Description: Return the number (count) of vowels in the given string. We will consider a, e, i, o, u as vowels for this Kata (but not y). The input string will only consist of lower case letters and/or spaces. Solution: 1. Check whether the characters in the 'sentence' are included in 'aeiou'. 2. Returns the number of included characters. def get_count(sentence): return sum([i in 'aeiou' for i i.. 2022. 4. 22.
String ends with? Description: Complete the solution so that it returns true if the first argument(string) passed in ends with the 2nd argument (also a string). Examples: solution('abc', 'bc') # returns true solution('abc', 'd') # returns false Solution: 1. Return True if the last digit of 'string' is the same as 'ending'. 2. If 'ending' is an empty string, return True. 3. If not, return False. def solution(strin.. 2022. 4. 21.
SQLAlchemy를 이용해 csv파일 DB업로드 하는 방법(feat. psql) CSV 대량의 데이터를 디비에 업로드하기 위해 사용되는 것 중에 하나가 csv파일입니다. csv파일은 데이터들이 콤마로 구분되어진 파일을 뜻하는데 엑셀이나 스프레드 시트 등에서 쉽게 변환시켜 다운로드할 수 있습니다. 오늘은 실습으로 krx 한국거래소에서 제공하는 종목 데이터를 디비에 업로드해보겠습니다. 먼저 krx 한국거래소에서 받은 종목 데이터 파일은 다음과 같습니다. (csv로 다운받을 수 있습니다) # stock.csv 종목코드,종목명,시장구분,소속부,종가,대비,등락률,시가,고가,저가,거래량,거래대금,시가총액,상장주식수 60310,3S,KOSDAQ,중견기업부,3445,15,0.44,3450,3485,3430,61292,211021945,159405362285,46271513 95570,AJ네트웍스,.. 2022. 4. 21.
Remove the minimum Description: The museum of incredible dull things The museum of incredible dull things wants to get rid of some exhibitions. Miriam, the interior architect, comes up with a plan to remove the most boring exhibitions. She gives them a rating, and then removes the one with the lowest rating. However, just as she finished rating all exhibitions, she's off to an important fair, so she asks you to wr.. 2022. 4. 20.