| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
- 오블완
- C++
- 반복문
- baekjoon
- Object Oriented Programming
- string
- 파이썬
- 함수
- const
- predictive analysis
- pointer
- 알고리즘
- raw data
- function
- 티스토리챌린지
- 배열
- Data Science
- Deep Learning
- Pre-processing
- vscode
- pass by reference
- Class
- assignment operator
- 포인터
- 백준
- Python
- OOP
- 문자열
- array
- programming
- Today
- Total
목록python (17)
Channi Studies
There are some ways in Python to analyze string. substring in sReturns True if the string s contains substring and False otherwise.if "-" is not in name: ...s.count(substring)Returns the number of non-overlapping occurrences of substring in s.s.endswith(substring)Returns True if the string s ends with the substring and False otherwise.s.startswith(substring)Returns True if the string s starts w..
https://www.acmicpc.net/problem/2563 2563번: 색종이 가로, 세로의 크기가 각각 100인 정사각형 모양의 흰색 도화지가 있다. 이 도화지 위에 가로, 세로의 크기가 각각 10인 정사각형 모양의 검은색 색종이를 색종이의 변과 도화지의 변이 평행하도록 www.acmicpc.net 코드 paper_list = [[0 for i in range(100)] for j in range(100)] times = int(input()) for _ in range(times): x, y = map(int, input().split()) for row in range(x, x+10): for col in range(y, y+10): paper_list[row][col] = 1 result ..
https://www.acmicpc.net/problem/10789 10789번: 가상 키보드 입력 입력의 첫 번째 줄(행)에는 두 개의 정수 r과 c (1 ≤ r, c ≤ 50)가 포함되어 가상 키보드 격자의 행과 열 수를 제공합니다. 가상 키보드는 다음 r 행에 표시되며 각 행에는 c 문자가 들어 있습니다. www.acmicpc.net 코드 my_list = [] for _ in range(5): my_list.append(list(input())) for row in range(15): for col in range(5): try: print(my_list[col][row], end="") except: continue 설명 1. my_list에 입력값을 한줄 씩 list로 변환하여 저장한다. (2..
문제 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 ..