「Flask+ツイキャスAPI、VRChatでライブ配信を見る」の記事で使うプログラムになります。 https://qiita.com/meihei/items/8dda62f510b8f8c9a15b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
TBD |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import sympy as sp | |
r = sp.Symbol('r') | |
expr_a = ( 2/(1+r)) + ( 2/((1+r)**2)) + (102/((1+r)**3)) | |
expr_b = ( 2/(1+r)) + (102/((1+r)**2)) | |
pa = 102.94 | |
pb = 98.03 | |
print("r_a:", sp.solve(expr_a - pa)) | |
print("r_b:", sp.solve(expr_b - pb)) |