250x250
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- Python3
- count
- 파이썬 슬라이싱
- html
- 백준
- sql
- 단어 공부
- ORDER BY
- 파이썬
- python
- 데이터
- where
- Django
- 프로그래머스
- List Comprehension
- Len
- Join
- 설계
- date_format
- map
- css
- 프로젝트
- YOLOv5
- 슬라이싱
- GIT
- SQL 고득점 Kit
- pcce 기출문제
- 파이썬 몫
- 코딩테스트 연습
- 아이엠어바텐더
Archives
- Today
- Total
목록팰린드롬인지 확인하기 (1)
nan + nan = 2nan
![](http://i1.daumcdn.net/thumb/C150x150/?fname=https://blog.kakaocdn.net/dn/c73Nr5/btsFeSHhXRx/P7oAZ5XDDBqKIxkjbwYm0K/img.png)
코드 입력 word = input() # 단어 길이가 짝수일 경우 if (len(word)%2)==0: # 중간 두 문자 중 첫째 문자 인덱스 (ex. abcd -> b) std = len(word) // 2 # 앞 문자열 (ab) start_ = word[0:std] # 뒤 문자열 (cd) end_ = word[std:] # 앞 문자열과 뒷 문자열의 역순이 일치하면 1, 아니면 0 if start_ == end_[::-1]: print(1) else: print(0) # 단어 길이가 홀수일 경우 else: # 중간 문자의 인덱스 (ex. abcde -> c) std = len(word) // 2 # 앞 문자열 (ab) start_ = word[0:std] # 뒤 문자열 (cd) end_ = word[s..
Python/백준 알고리즘
2024. 3. 1. 16:15