有人可以帮助解决这个python问题吗?
问题: - 当变量具有整数值时,我需要一起打印多个变量。
如果它有助于我尝试制作音量计算器,这是用于上下文:
if(custom_answer is True and preset_answer is False):
custom_length_answer=input("Length=")
custom_width_answer=input("Width=")
custom_height_answer=input("Height=")
a=custom_length_answer
b=custom_width_answer
c=custom_height_answer
while custom_answer is True and preset_answer is False:
print("The volume of your custom measurements is..."int(a*b)*c)
答案 0 :(得分:0)
好的!所以我假设:
这就是你的代码应该是这样的:
if (custom_answer == True and preset_answer == False):
custom_length_answer = a = int(raw_input("Length= ") # assign variable to a and assuring that it is already an integer using the int.
custom_length_answer = b = int(raw_input("Width= ") # Same as above
custom_length_answer = c = int(raw_input("Height= ") # Same as above
return a # returning the value of the variables
return b
return c
while custom_answer == True and preset_answer == False: # Your loop
print("The volume of your custom measurements is:" + a*b*c)
# some more code
希望这有帮助! :)