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
- predictive analysis
- 배열
- pass by reference
- string
- Class
- 티스토리챌린지
- raw data
- assignment operator
- 함수
- 파이썬
- 포인터
- 반복문
- 문자열
- Data Science
- Pre-processing
- 오블완
- const
- function
- Python
- Object Oriented Programming
- baekjoon
- vscode
- array
- C++
- OOP
- 백준
- 알고리즘
- pointer
- Deep Learning
- programming
Archives
- Today
- Total
목록Programmers (1)
Channi Studies
문제 for문 내에서 queires 내의 index들을 반복적으로 my_string에 적용시키면서, 적용된 내용을 다시 my_string에 저장하는 방식으로 하면 될 것 같다. 코드 및 설명 def solution(my_string, queries): result = my_string for index in queries: front_string = result[:index[0]] mid_string = result[index[0]: index[1] + 1] back_string = result[index[1] + 1:len(result)] result = front_string + mid_string[::-1] + back_string return result for문 속의 string slicing ..
python
2023. 10. 11. 15:23