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
- index
- WECODE
- range
- sum
- count
- map
- decorator
- len
- slice
- Algorithm
- and
- split
- DART
- 위코드
- enumerate
- Python
- list
- 파이썬
- Sorted
- or
- FOR
- LOWER
- lambda
- join
- SQL
- If
- iNT
- js
- MAX
- STR
Archives
- Today
- Total
코드로 우주평화
1218. Remove First and Last Character 본문
It's pretty straightforward. Your goal is to create a function that removes the first and last characters of a string. You're given one parameter, the original string. You don't have to worry with strings with less than two characters.
Solution:
def remove_char(s: str, limit: int = 1):
return s[limit:-limit]
'나는 이렇게 학습한다 > Algorithm & SQL' 카테고리의 다른 글
1220. The 'if' function (0) | 2022.12.20 |
---|---|
1219. Return the day (0) | 2022.12.19 |
1217. Regexp Basics - is it a digit? (0) | 2022.12.17 |
1216. Define a card suit (0) | 2022.12.17 |
1215. Is it even? (0) | 2022.12.15 |