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
- web
- Class
- data structure
- DATAPATH
- control
- DoM
- instruction
- Algorithm
- DS
- MIPS
- Linux
- for
- XML
- Pipelining
- javascript
- mysql
- system
- CSS
- function
- html
- DB
- php
- architecture
- Java
- MacOS
- github
- computer
- python
- while
- react
Archives
- Today
- Total
YYYEJI
[Python] 산술 계산 본문
728x90
산술(Arithmetic)에 대해서 예제를 통해서 알아보아요.
더하기(Addtion)
add = 1+1
빼기(Subtraction)
sub = 1-1
곱하기 (Multiplication)
mul = 2*10
나누기(Division)
div = 10/2
나누기-몫 (Division-quotient)
quo = 7//2
나누기-나머지(Division-remainder)
rem = 7%4
제곱(Square)
squ = 2**5
기호를 줄여서 사용할 수도 있습니다.
add += 2 # add = add + 2
sub -= 2 # sub = sub - 2
mul *- 2 # mul = mul * 2
div /= 2 # div = div / 2
◡̈
'Python' 카테고리의 다른 글
[Python] 리스트(list) 정리 (0) | 2022.09.23 |
---|---|
[Python] 이스케이프(Escape) 문자란? (0) | 2022.09.23 |
[Python] 형변환(Type Conversion)이란? (2) | 2022.09.23 |
[Python] input 함수란? (0) | 2022.09.23 |
[Python] 데이터 타입(Data Types)의 정의와 종류 (2) | 2022.09.23 |