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
- YOLO
- Visual Studio
- C
- JSON
- Numpy
- ubuntu
- 기타 연주
- pandas
- SSH
- pip
- 핑거스타일
- Linux
- pytorch
- OpenCV
- C#
- Docker
- Python
- 컨테이너
- 채보
- label
- error
- mysql
- Selenium
- VS Code
- windows forms
- 프로그래머스
- nvidia-smi
- C++
- 오류
- paramiko
Archives
- Today
- Total
기계는 거짓말하지 않는다
Python 소수점 제한, 출력 본문
number = 3.141592
number2 = 10.7562149
# round 반올림
print(round(number, 2)) # 3.14
print(round(number)) # 3
print(round(number2)) # 11
number = round(number, 3)
print(number) # 3.142
# 출력 시 제한
print(f"{number2:.2f}") # 10.76
print("{:.4f}, {:.5f}".format(number2, number2)) # 10.7562, 10.75621'Python' 카테고리의 다른 글
| Python Error argument after * must be an iterable, not Queue (0) | 2022.06.10 |
|---|---|
| Python configparser key 대소문자 구분 (0) | 2022.05.21 |
| Python Directory 이동, 복사, 삭제(하위 폴더, 디렉터리 포함) (0) | 2022.05.01 |
| Python Shell 명령어, subprocess (0) | 2022.04.24 |
| Python Thread (0) | 2022.04.23 |
Comments