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 | 29 | 30 | 31 |
Tags
- 단어 공부
- 파이썬
- Python3
- 파이썬 슬라이싱
- YOLOv5
- 파이썬 몫
- date_format
- 슬라이싱
- ORDER BY
- 프로젝트
- SQL 고득점 Kit
- pcce 기출문제
- html
- 코딩테스트 연습
- count
- Join
- where
- Django
- css
- sql
- python
- GIT
- 프로그래머스
- Len
- 아이엠어바텐더
- 데이터
- 설계
- List Comprehension
- 백준
- map
Archives
- Today
- Total
목록팰린드롬인지 확인하기 (1)
nan + nan = 2nan

코드 입력 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