Notice
Recent Posts
Recent Comments
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | ||
6 | 7 | 8 | 9 | 10 | 11 | 12 |
13 | 14 | 15 | 16 | 17 | 18 | 19 |
20 | 21 | 22 | 23 | 24 | 25 | 26 |
27 | 28 | 29 | 30 |
Tags
- 데이콘
- Real or Not? NLP with Disaster Tweets
- 파이썬
- 백준
- 편스토랑
- hackerrank
- 캐치카페
- 코로나19
- ChatGPT
- 자연어처리
- AI 경진대회
- Baekjoon
- Kaggle
- 편스토랑 우승상품
- Git
- dacon
- ubuntu
- 우분투
- 프로그래머스
- leetcode
- 맥북
- github
- SW Expert Academy
- PYTHON
- Docker
- programmers
- gs25
- 더현대서울 맛집
- 금융문자분석경진대회
- 프로그래머스 파이썬
Archives
- Today
- Total
목록
반응형
2020/09/15 (2)
반응형
솜씨좋은장씨
[Python] 이중 for 문 한 줄로 작성하는 방법
for 문을 한 줄로 작성하는 방법 ex ) 여러개의 단어가 들어있는 리스트 중에서 길이가 3 이상인 단어만 남기고 싶을 경우 words = ["솜씨좋은장씨", "티스토리", "블로그", "파이썬", "for", "프로그래밍", "반복"] new_words = [ "솜씨좋은장씨", "티스토리", "프로그래밍" ] 기존 코드 new_words = [] for word in words: if len(word) > 3: new_words.append(word) 한 줄로 작성 new_words = [ word for word in words if len(word) > 3 ] 이중 for 문을 한 줄로 작성하는 방법 ex ) 여러 단어들이 담겨있는 2차원 리스트에서 각 리스트 별로 길이가 4 이상인 단어만 남기고..
Programming/Python
2020. 9. 15. 11:29
[leetCode] 1550. Three Consecutive Odds (Python)
Given an integer array arr, return true if there are three consecutive odd numbers in the array. Otherwise, return false. Example 1: Input: arr = [2,6,4,1] Output: false Explanation: There are no three consecutive odds. Example 2: Input: arr = [1,2,34,3,4,5,7,23,12] Output: true Explanation: [5,7,23] are three consecutive odds. Constraints: 1
Programming/코딩 1일 1문제
2020. 9. 15. 00:30
반응형