我需要用循环来写这个程序
http://imgur.com/CGRMn
这是我到目前为止,但我的程序必须看起来准确和图片???你知道吗
def main():
sum=0.0
for i in range(1,6):
x,y=eval(input("Please enter length and width of room:"))
sf=(x*y)
sum=sum+sf
print("The total square footage is",sum)
main()
谢谢你的帮助。。。你知道吗
Tags:
只需在print语句上删除缩进。你知道吗
编辑:
这是python中的一种常用技术,您可以使用它来实现所需的功能:
我在这里做的是在字符串中间放置一个通配符,然后传递参数%我告诉%操作符你要插入一个整数。如果要添加字符串,也可以放置“%s”。还有几个你可以查。这是控制台的另一个示例:
相关问题 更多 >
编程相关推荐