티스토리 뷰
python은 뭔가를 해도 그냥 다 만들어 놓은 언어같습니다.
심심해서 만든 lotto 발생기
import random
def lotto(sort=True):
result = []
numbers = list(range(1, 46))
for _ in range(6):
number = random.choice(numbers)
result.append(number)
numbers.remove(number)
if sort:
result.sort()
return result
print(lotto())
'Coding' 카테고리의 다른 글
| Swift. Snake -> Camel, Camel -> Snake (0) | 2023.02.18 |
|---|---|
| Algorithm. permutation 순회 (0) | 2020.12.28 |
| Dynamic Programming (0) | 2020.12.19 |
| Node.js - 구구단 (0) | 2020.09.03 |
| Ruby. Gugudan (0) | 2020.08.30 |
댓글
공지사항
최근에 올라온 글
최근에 달린 댓글
- Total
- Today
- Yesterday
TAG
- intellij
- php
- windows10
- Kotlin
- rxswift
- SWIFT
- Linux
- war
- github
- tomcat
- ubuntu
- CentOS
- MySQL
- android
- golang
- git
- Codable
- Gradle
- docker
- Spring
- Xcode
- go
- cocoapods
- centos8
- Python
- Java
- enum
- ios
- Windows
- nodejs
| 일 | 월 | 화 | 수 | 목 | 금 | 토 |
|---|---|---|---|---|---|---|
| 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 |
글 보관함