Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
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 |
Tags
- SPC
- mapreduce
- JavaScript
- SQL
- hadoop
- Express
- Android
- GIT
- react
- tomcat
- table
- window
- Java
- xPlatform
- SSL
- Spring
- vaadin
- Python
- R
- IntelliJ
- Sqoop
- 보조정렬
- MSSQL
- plugin
- NPM
- mybatis
- es6
- Eclipse
- 공정능력
- Kotlin
Archives
- Today
- Total
728x90
목록sample (1)
DBILITY
python lottery number generation exercise ( 로또 번호 생성)
그냥 해봤다. 새로운 언어(?)의 사용법을 조금 익히면 항상 그렇다. text파일을 write mode로 여는 부분이 있고 1~46까지 6개의 무작위 번호를 추출하는 부분은 다음과 같다. >>> import random >>> random.sample(range(1,47),k=6) [37, 21, 2, 27, 31, 28] #결과가 오름차순으로 정렬이 안되어 있어 다음과 같이 sorted를 사용 >>> sorted(random.sample(range(1,47),k=6)) [11, 25, 29, 31, 41, 42] import random import re def lotto(game=5): ele_len: int = 6 NL: str = '\n' try: f = open('fortune_num.txt',..
python
2021. 8. 13. 17:43
728x90