-1
我想打一个程序图中,两个理想气体,但壳推出这个错误:IDEAL GASSES TypeError:不能通过类型为'float'的非整型来乘序列3.4.4?
line 10, in P1
return (P*(Vn[c]))/(T[c2])
TypeError: can't multiply sequence by non-int of type 'float'
这是我的计划:
#Prueba de gráfica de gas ideal con volumen molar
import numpy as np
from matplotlib import pyplot as plt
#Sea Vn=miu/densidad... VnNeón=16.82 ml/mol, VnCriptón=32.23 ml/mol
Vn=[16.82,32.23]
T=[0.01,60,137,258]
c=0 #contador del material
c2=0 #contador temperatura
def P1(P): #Función de P:
return (P*(Vn[c]))/(T[c2])
P= list(range(0,800))
while c<=1:
while c2<=3:
print(P1(P),Vn[c],T[c2])
c2=c2+1
c=c+1
我能做什么呢? 我在Windows 10中使用Python 3.4.4。我想获得一个依赖于P的P(P从0变到800)的图形,列表T中的每个温度对于每个摩尔体积的氖和Kripton列表Vn。 为什么我不能用P乘以和划分列表的这些元素? 非常感谢。
你应该输入你的代码,它说“在这里输入代码”。 – user2357112
对不起,我已经发布了代码。 – Moneqz