๋ฐ์ํ
map ํจ์
packing error์ unpacking error
https://eat-sleep-code-repeat.tistory.com/7
splitํจ์
https://ooyoung.tistory.com/13
์ ๊ณฑ ํํ(+ ๋ด์ฅํจ์)
2์ฐจ๋ฐฉ์ ์
from sympy import Symbol, solve
x = Symbol('x')
y = Symbol('y')
equation1 = x + 2*y - 3
equation2 = 3*x - y + 2
Result = solve((equation1, equation2), dict=True)
print(Result)
#[{x: -1/7, y: 11/7}]
sqrtํจ์
import math
math.sqrt( x )
1002๋ฒ ํฐ๋ ๋ฌธ์
๊ฐ์ฅ ๋น ๋ฅธ ํ์ด 31200์์ 29000ms ๋๋ก ๊ฐ๋ฅ
cnt = int(input())
for i in range(1,cnt+1):
x1,y1,r1,x2,y2,r2 = map(int,input().split())
d = (pow(x1-x2,2) + pow(y2-y1,2))**0.5
if abs(r1-r2)< d < r1+r2:
print(2)
elif d!=0 and abs(r1-r2)==d or r1+r2==d:
print(1)
elif d==0 and r1==r2:
print(-1)
else :
print(0)
๋ฐ์ํ
'๐๏ธ์ํํธ์จ์ด > ๐ปpython' ์นดํ ๊ณ ๋ฆฌ์ ๋ค๋ฅธ ๊ธ
[Python] 1๋ถ๋ง์ ์ ๋ฆฌํ๋ python ํจ์ 1 (0) | 2021.11.04 |
---|---|
[ML] ๋ ๋ฒ์ฏ ๋ฐ์ดํฐ ๋ถ์-Decision Tree(feat. ๊ฒฐ์ ํธ๋ฆฌ) (0) | 2021.11.03 |
python resample (0) | 2021.10.20 |
vscode๋ก ์ฃผํผํฐ notebook ์ฌ์ฉํ๊ธฐ (0) | 2021.10.20 |
matplotlib ์์ ์ข ๋ฅ (0) | 2021.10.20 |