방법
from datetime import datetime
str = "2023.10.08"
format = "%Y.%m.%d"
dt = datetime.strptime(str, format)
print(dt)
# => 2023-10-08 00:00:00
from datetime import datetime
str = "2023.10.08"
format = "%Y.%m.%d"
dt = datetime.strptime(str, format)
print(dt)
# => 2023-10-08 00:00:00
ascii_lowercase
사용ascii_uppercase
사용from string import ascii_lowercase
from string import ascii_uppercase
# 소문자 알파뱃 리스트
# => ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k …
def solution(cards1, cards2, goal):
answer = ''
for target in goal:
if len(cards1) > 0 and target == cards1[0]:
cards1.pop(0)
elif …
$ pip install pip-autoremove
$ pip-autoremove {library_name} -y
pip install Django==<version>
python -m django --version
django-admin startproject config .
-- development
python manage.py runserver 8000
-- production
python manage.py runserver 0 …
search_str = 'X'
two_dim_arr = [['O', 'O', 'O'], ['O', 'O', 'X'], ['O', 'O', 'O']]
answer=[(i, j) for i in range(len(two_dim_arr)) for j in range(len(two_dim_arr[0])) if two_dim_arr[i][j] == search_str][0]
print(answer)
# -> (1, 2)
search_str = 'X'
two_dim_arr = [['O', 'O', 'O …
one_dim_arr = ["abc", "def", "ghi"]
two_dim_arr = []
for p in one_dim_arr:
two_dim_arr.append(list(p))
print(two_dim_arr)
# -> [['a', 'b', 'c'], ['d', 'e', 'f'], ['g', 'h', 'i']]
one_dim_arr = ["abc", "def", "ghi"]
two_dim_arr = [list(row) for row in one_dim_arr]
print(two_dim_arr)
# -> [['a', 'b', 'c'], ['d', 'e', 'f'], ['g …