전체보기
-
테이블 해시 함수코딩 테스트/Level 2 2022. 12. 24. 13:04
https://school.programmers.co.kr/learn/courses/30/lessons/147354 from functools import reduce solution = lambda data, col, row_begin, row_end: reduce(lambda x, y: x ^ y, (sum(each % (i + 1) for each in sorted(data, key=lambda x: (x[col - 1], -x[0]))[i]) for i in range(row_begin - 1, row_end))) def solution(data, col, row_begin, row_end): data.sort(key=lambda x: (x[col - 1], -x[0])) answer = None..
-
pyttsx3Python/이것저것 파이썬 2022. 12. 23. 15:39
pip install pyttsx3 import pyttsx3 engine = pyttsx3.init() engine.setProperty('rate', 120) engine.say('안녕하세요?') engine.runAndWait() https://github.com/nateshmbhat/pyttsx3 GitHub - nateshmbhat/pyttsx3: Offline Text To Speech synthesis for python Offline Text To Speech synthesis for python. Contribute to nateshmbhat/pyttsx3 development by creating an account on GitHub. github.com https://pyttsx3.r..
-
파이참, 깃헙 데스크탑 초기 설정Python/이것저것 파이썬 2022. 12. 23. 10:37
파이참 공식 기능을 쓰십시오. 파이참도 공식적으로 깃헙을 지원하기 때문에 파이참에서 제공되는 기능을 쓰면 됩니다. 저는 깃헙 데스크탑만 쓰는 게 편해서 저는 깃헙을 GUI로 시작했고.... 이런 저런 개발환경을 두루 두루 사용해 오다 보니, 파이참의 깃헙 지원보다는 깃헙 데스크탑이 편해서... 이런 방법으로 레포지토리를 생성합니다. 깃헙 데스크탑만으로 기존 폴더를 레포지토리로 설정하는 법 이 글은 깃헙 데스크탑 만으로 기존 폴더를 레포지토리로 설정하는 법에 대한 글입니다. 저는 로컬에서 어느 정도 작업이 이루어진 뒤에, 깃헙에 올리는 경우가 많습니다. 그런데 깃헙 데스크탑의 메뉴에 있는 'New repository...'로 폴더를 생성하면 선택한 폴더 아래에 하위폴더가 생성되고, 하위폴더가 새로운 레포지..
-
ttkbootstrapPython/이것저것 파이썬 2022. 12. 22. 18:31
https://ttkbootstrap.readthedocs.io/en/latest/themes/ Themes - ttkbootstrap Themes ttkbootstrap comes packaged with a LOT of beautifully styled light and dark themes, which you can view in a demo by typing this command into your terminal after installing ttkbootstrap. >>> python -m ttkbootstrap You will see a demo screen that look ttkbootstrap.readthedocs.io https://github.com/israel-dryer/ttkbo..
-
사칙연산코딩 테스트/Level 4 2022. 12. 21. 21:53
https://school.programmers.co.kr/learn/courses/30/lessons/1843 DP 대신 재귀와 lru_cache로 풀 수 있을 때도 있다~! from functools import lru_cache def solution(arr): @lru_cache(maxsize=None) def solve(t): if len(t) == 1: return [int(t[0])] result = [n1 + (n2 if t[i] == "+" else -n2) for i in range(1, len(t), 2) for n1 in solve(t[:i]) for n2 in solve(t[(i + 1):])] return [max(result), min(result)] return max(sol..
-
위양성, 위음성초간단 통계 2022. 12. 20. 14:55
https://www.khan.co.kr/science/science-general/article/202009250600015어떤 진단 키트의 정확도는 95% 이다. (이 키트의 민감도와 정확도는 같다.)이 병의 유병률(전체 인구 중 환자의 비율)은 1%이때 (1) 병에 걸렸지만 음성으로 나올 확률과 (2) 음성이지만 병에 걸려 있을 확률을 알아보자...10000명을 대상으로 한다고 가정했을 때 유병률이 1%이니 환자는 100명, 건강한 사람은 9900명정확도가 95% 이므로 환자 100명 중 5명은 환자가아니다. 건강인 9900명 중 475명은 환자이다. 즉 다음과 같은 상황이 펼쳐질 때... 양성음성 환자95(진양성)5 (위음성)100건강인475 (위양성)94..