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 | 31 |
Tags
- 머신러닝 입문 강좌 | TEAMLAB X Inflearn |
- Pickle
- preprocessing
- 오블완
- dvdrental
- postgresql
- search ads
- 문자열 함수
- inflearn
- google sa
- 외장함수
- MAC
- 검색광고 캠페인
- b2b 마케팅
- Def
- 파이썬
- ndarray
- dbeaver
- PYTHON
- EXCEPT
- 티스토리챌린지
- 디지털 검색광고
- 파이썬 코딩 무료 강의 (기본편) - 6시간 뒤면 여러분도 개발자가 될 수 있어요 [나도코딩]
- pgAdmin
- GA4
- sql
- 퍼포먼스 마케팅
- 양승화
- 데이터 전처리
- 숫자형
Archives
- Today
- Total
Maron's DATA Log
[Python] Random (랜덤) 함수 본문
# Random (랜덤) 함수
: 임의의 값 생성
from random import *
# random
print(random( )) # 0.0 ~ 1.0 미만의 임의의 값 생성
print(random( ) * 10) # 0.0 ~ 10.0 미만의 임의의 값 생성
print(int(random( ) * 10)) # 0 ~ 10 미만의 임의의 값 생성
print(int(random( ) * 10) + 1) # 1 ~ 10 이하의 임의의 값 생성
print(int(random( ) * 45) + 1) # 1 ~ 45 이하의 임의의 값 생성
# randrange
print(randrange(1, 11)) # 1 ~ 11 미만의 임의의 값 생성
print(randrange(1, 46)) # 1 ~ 45 미만의 임의의 값 생성
# randint
print(randint(1, 10)) # 1 ~ 10 이하의 임의의 값 생성
print(randint(1, 45)) # 1 ~ 45 이하의 임의의 값 생성
'Python' 카테고리의 다른 글
[Python] 조건문 - If / 반복문 - For & While (1) | 2020.11.30 |
---|---|
[Python] 자료 구조 - List, Dictionary, Tuple, Set (0) | 2020.11.29 |
[Python] 문자열 함수 (0) | 2020.11.27 |
[Python] class 와 instance(object) // 기본 용어 (0) | 2020.11.21 |
[Python] 기본 문법 - 숫자 / 리스트 / 인덱싱 / 슬라이싱 (0) | 2020.11.20 |
Comments