ALL (300) 썸네일형 리스트형 [stratascratch] Number Of Units Per Nationality(Python) 문제 Find the number of apartments per nationality that are owned by people under 30 years old. Output the nationality along with the number of apartments. Sort records by the apartments count in descending order. 30세 미만 인구가 소유한 국적별 아파트 수 조회하기 아파트 수를 기준으로 내림차순 정렬 코드 # Import your libraries import pandas as pd # Start writing code airbnb_hosts.head() df = pd.merge(airbnb_hosts, airbnb_units, how="i.. [프로그래머스] 시저 암호 (Python) 문제 어떤 문장의 각 알파벳을 일정한 거리만큼 밀어서 다른 알파벳으로 바꾸는 암호화 방식을 시저 암호라고 합니다. 예를 들어 "AB"는 1만큼 밀면 "BC"가 되고, 3만큼 밀면 "DE"가 됩니다. "z"는 1만큼 밀면 "a"가 됩니다. 문자열 s와 거리 n을 입력받아 s를 n만큼 민 암호문을 만드는 함수, solution을 완성해 보세요. 코드 def solution(s, n): answer = [] for val in s: if val == ' ' : answer.append(' ') else : if val.islower(): # 소문자일 경우 answer.append(chr((ord(val) - ord('a') + n) % 26 + ord('a'))) elif val.isupper() : # 대문.. [프로그래머스] 직사각형 별찍기 (Python) 문제 이 문제에는 표준 입력으로 두 개의 정수 n과 m이 주어집니다. 별(*) 문자를 이용해 가로의 길이가 n, 세로의 길이가 m인 직사각형 형태를 출력해보세요. 코드 a, b = map(int, input().strip().split(' ')) for _ in range(b) : print(a * '*') a, b = map(int, input().strip().split(' ')) print(("*" * a + "\n") * b) 출처 [stratascratch] Bikes Last Used(Python) 문제 Find the last time each bike was in use. Output both the bike number and the date-timestamp of the bike's last use (i.e., the date-time the bike was returned). Order the results by bikes that were most recently used. 각 자전거가 마지막으로 사용된 시간 찾기. 자전거 번호와 자전거의 마지막 사용 날짜(자전거가 반환된 날짜) 조회 가장 최근에 사용한 순서로 정렬 코드 # Import your libraries import pandas as pd # Start writing code dc_bikeshare_q1_2012.head() d.. 이전 1 ··· 11 12 13 14 15 16 17 ··· 75 다음