목록Python (16)
일상 코딩

저중량 원판 파워리프팅 저중량 원판이 두께가 얇아 크라토스 중량 덤벨에는 더 적합하다고 판단 하지만 길이가 긴 zeid 중량 덤벨에는 역도용 원판도 무리 없이 다 들어가기에 본인에게 맞다고 생각하는 것을 두께를 계산해서 판단하면 되겠다. 로더블 덤벨 파이썬 코드 plate = [0.25, 0.50, 1.00, 1.25, 2.50, 5.00] loadable = 4.50 # 원판 조합 plate_combi = [] for a in [0, plate[0]]: for b in [0, plate[1]]: for c in [0, plate[2]]: for d in [0, plate[3]]: for e in [0, plate[4]]: for f in [0, plate[5]]: plate_combi.append([a..
1 ~ 70 까지 5개, 1~25 중에 1개 import random def mega(start_num, end_num, select_num): mega_number = [ i for i in range(start_num, end_num + 1) ] last_num = random.randint(1,25) random.shuffle(mega_number) # 값을 반환하지 않고 lotto_number 리스트에 그대로 적용해버림 res = sorted(mega_number[0:5]) res.append(last_num) return res if __name__ == "__main__": for i in range(10): mega_str = '' mega_nums = mega(1,70,5) for j in..
1 ~ 45 까지 6 가지 숫자 선정하는 방식 def lotto(): select_number = 6 lotto_number = [ i for i in range(1,46) ] random.shuffle(lotto_number) start = random.randrange(0,39) end = start + select_number return sorted(lotto_number[start:end]) if __name__ == "__main__": for i in range(10): lotto_str = '' lotto_nums = lotto() for j in lotto_nums: lotto_str += f"{j:2d}, " print(f"{i+1:02d}회 로또 번호: {lotto_str[:-2]}"..

https://youtu.be/LXJhA3VWXFA MacOS M1 AppleSilicon 환경 Homebrew 통한 Docker 설치 https://codewagon.tistory.com/2 [Docker]M1 Mac에서 homebrew를 활용한 docker 설치 방가워요. 여러분! 제 소개를 할게요. 저는 참견쟁이 코드웨건이에요! 오늘 공부할 내용은 맥북에서 Docker를 설치해볼 것인데, 그 중 Apple Silicon이 장착된 M1맥북에 설치를 진행할 것 입니다. 저 같 codewagon.tistory.com Docker에 python 가상환경 구축 https://i-am-eden.tistory.com/32 도커로 파이썬 코드 실행하기, Run python code with docker DVC라는..
maze.py from enum import Enum from typing import List, NamedTuple, Callable, Optional import random from math import sqrt from urllib.parse import MAX_CACHE_SIZE from generic_search import dfs, node_to_path, Node #, bfs, astar class Cell(str, Enum): EMPTY = " " BLOCKED = "X" START = "S" GOAL = "G" PATH = "*" class MazeLocation(NamedTuple): row: int column: int class Maze: def __init__(self, rows..

from enum import Enum from typing import List, NamedTuple, Callable, Optional import random from math import sqrt from urllib.parse import MAX_CACHE_SIZE # from generic_search import dfs, bfs, node_to_path, astar, Node class Cell(str, Enum): EMPTY = " " BLOCKED = "X" START = "S" GOAL = "G" PATH = "*" class MazeLocation(NamedTuple): row: int column: int class Maze: def __init__(self, rows: int = ..
MacOS 터미널 세팅 아래 링크 참조 후 설치 진행한다. https://polarcompass.tistory.com/140?category=514165 설치 $ brew install miniforge 삭제 $ brew uninstall miniforge conda 명령어 및 단축키 https://polarcompass.tistory.com/136?category=520069 Miniconda3 Conda 가상환경 설치 및 설정 Mini Conda 설치 1. 파이썬 버전별 설치 파일 다운로드 링크 ● Linux https://docs.conda.io/en/latest/miniconda.html#linux-installers Miniconda — Conda documentation Miniconda is..

Mini Conda 설치 파이썬 버전별 설치 파일 다운로드 링크 ● Linux https://docs.conda.io/en/latest/miniconda.html#linux-installers Miniconda — Conda documentation Miniconda is a free minimal installer for conda. It is a small, bootstrap version of Anaconda that includes only conda, Python, the packages they depend on, and a small number of other useful packages, including pip, zlib and a few others. Use the conda in d..
https://comdoc.tistory.com/entry/Python-Zip-2%EC%B0%A8%EC%9B%90-%EB%B0%B0%EC%97%B4-%ED%9A%8C%EC%A0%84 Python Zip 2차원 배열 회전 1. zip 내장 함수(BIF) zip은 각 iterables의 요소들을 하나씩 모아 이터레이터를 만듭니다. iterable (이터러블) 멤버들을 한 번에 하나씩 돌려줄 수 있는 객체. 이터러블의 예로는 모든 (list, str, tuple 같 comdoc.tistory.com https://choichumji.tistory.com/74 [python] 2차원 리스트 90도 돌리기 def rotated(array_2d): list_of_tuples = zip(*array_2d[::-1])..
https://zidarn87.tistory.com/25 파이썬 리스트, 튜플 정렬하기 - sort(), sorted(), reverse() 파이썬 정렬하기 - sort(), sorted(), reverse() sort() 기본값은 오름차순 정렬이고, reverse옵션 True는 내림차순으로 정렬하게 됩니다. a= [3, 1, 9, 7, 5] a.sort() print(a) [1, 3, 5, 7, 9] a= [3, 1,.. zidarn87.tistory.com