What's so special about the number 105263157894736842? This number doubles if you move the rightmost digit to the front of the number. In addition, this is the smallest natural number that has this property.In general, a positive natural number that can be multiplied by nn by moving the rightmost digit to the front of the number is called an nn-parasitic number. Here nn is itself a single-digit ..
클로저는 일반 함수와 다르게, 자신(inner function)의 영역밖에서 호출된 함수의 변수값과 레퍼런스를 복사, 저장 접근을 가능하게 한다. def sort_priority(values, group): def helper(x): if x in group: return 0, x return 1, x values.sort(key=helper) numbers = [8, 33, 1, 2, 5, 4, 7, 6] group = {2, 3, 5, 7} sort_priority(numbers, group) print(numbers) sort_priority 의 동작은 group 이라는 집합에 포함되어 있으면 오름차순에서 우선순위를 준다. 멤버십 테스트를 통과 여부에 따라 0, 1의 가중치를 두어서 두그룹으로 분류..
The computer program cowsay generates ASCII pictures of a cow with a message.+----------------------------+| Moo may represent an idea, || but only the cow knows. |+----------------------------+ \ ^__^ \ (oo)\_______ (__)\ )\/\ ||----w | || ||The program initially started more or less as an inside joke within hacker culture, but has been around long enough that its use has become rather widespre..
The inhabitants on planet P people speak a strange language, called language P. For us, this language is not so difficult to learn. After all, it is very similar to plain English, but every group of vowels is followed by a letter p and a repetition of the same group of vowels. A groups of vowels is either a sequence of one or more consecutive vowels (a,e,i,o and u) or the combination ij. As such..
A Pythagorean triple (a,b,c)(a,b,c) consists of three strictly positive integers aa, bb and cc, for which a2+b2=c2a2+b2=c2. The name is derived from the Pythagorean theorem, stating that every right triangle has side lengths satisfying the formula a2+b2=c2a2+b2=c2. Thus, Pythagorean triples describe the three integer side lengths of a right triangle. However, right triangles with non-integer sid..
Five pirates are shipwrecked on a desert island. They quickly determine that the only other inhabitant of the island is a monkey and that the only food is coconuts. They set about collecting as many coconuts as they can and put them all in a pile. By nightfall they are too tired to divide the harvest, so they agree to go to sleep and divvy up the coconuts the next morning.During the night one pi..
[폰트사이즈18 고딕 진하게] workqueue 에 push 하고 pop 할때 마다 매번 다른 쓰레드로 동작 import threading import time def foo(t): i = 0 while True: print(threading.currentThread().getName(), i) i += 1 time.sleep(t) class WorkQueue: def __init__(self): self.works = list() def push(self, cb, *args, **kwargs): self.works.append((cb, args, kwargs)) def pop(self): if len(self.works): work, args, kwargs = self.works.pop(0) t = t..
[Thread] 폰트 사이즈 12 고딕 폰트 사이즈 12 고딕 폰트 사이즈 12 고딕 폰트 사이즈 12 고딕 폰트 사이즈 12 고딕 데몬쓰레드는 메인쓰레드가 종료되면 종료된다.import threading def sum(low, high): total = 0 for i in range(low, high): total += i print("sum=" + str(total)) t = threading.Thread(target=sum, args=(1, 100)) t.daemon = True t.start()
- Total
- Today
- Yesterday
- 파이썬 프로그래밍
- django chatbot
- 문서 비교
- chatbot
- virtualenv
- 문과 코딩
- 파이썬 강좌
- 장고 카톡 자동응답
- 모바일 스킨 적용
- Tistory
- PuTTYGen
- gitignore
- 엑셀 비교
- 파이썬
- admin.py
- 파이썬 독학
- 면접정답
- 이미지 비교
- 장고
- gitlab
- pycrypto
- 플러스친구 자동응답
- 장고 플러스친구 자동응답
- GIT
- wsgi
- django
- Python
- 모바일 테마 적용
- 면접답변
- 파이썬 입문
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |