题目:
1 Sickle 为 29 Knuts
1 Galleon 为 17 Sickle
问现有300 Galleon,用Sympy设Sickles,Galleon,Knuts三个未知数,并算出300 Galleon = 多少 Knuts。
我是这么写的:
import sympy as sp
sp.init_printing()
Knut = sp.symbols('Knut')
Sickles = sp.symbols('Sickles')
Sickles = 29*Knut
Galleon = 17*Sickles
lucre = sp.solve(300*Galleon, Knut)
print (lucre)
最终显示为[0],我想知道我哪里错了,应该咋改?
(最终结果应该是 ‘xxxx Knuts’ 的形式)