嘿家伙我完全失去了这个蟒蛇作业问题的问题是定义一个函数compute_gas_volume返回给定参数压力,温度和摩尔气体的体积。使用气体方程PV = nRT,其中P是以帕斯卡为单位的压力,V是以立方米为单位的体积,n是摩尔数,R是气体常数8.3144621(J /(mol * K)),T是以开尔文。计算气体函数
的启动代码
gas_const = 8.3144621
def compute_gas_volume((gas_pressure,,gas_temperature,gas_moles):
gas_pressure = 100.0
gas_moles = 1.0
gas_temperature = 273.0
gas_volume = 0.0
gas_volume = compute_gas_volume(gas_pressure, gas_temperature, gas_moles)
print('Gas volume:', gas_volume, 'm^3')
谁能帮我解答这个问题?
它看起来像你想我们为你写一些代码。尽管许多用户愿意为遇险的编码人员编写代码,但他们通常只在海报已尝试自行解决问题时才提供帮助。展示这一努力的一个好方法是包含迄今为止编写的代码,示例输入(如果有的话),期望的输出以及实际获得的输出(输出,回溯等)。您提供的细节越多,您可能会收到的答案就越多。检查[FAQ](http://stackoverflow.com/tour)和[如何提问](http://stackoverflow.com/questions/how-to-ask)。 – TigerhawkT3
你甚至不想努力将提示的第一个字母小写,或格式化它? ಠ_ಠ – TigerhawkT3
请参阅[本文](http://meta.programmers.stackexchange.com/questions/6166/open-letter-to-students-with-homework-problems)以解释如何提出作业问题。 – EJoshuaS