【发布时间】:2019-01-02 23:33:13
【问题描述】:
这是我的代码:
def arearectangle(length, breadth):
totalarea = length * breadth
return totalarea
def areasqr(side):
''' Objective : To compute the area of circle
Input parameters : Length and Breadth
Return Value : area - numeric Value
:rtype: int'''
area = side*side
return area
def addition(num1, num2):
'''The objective of this proram is to find the sum of two integers
input through keyboard'''
total = num1 + num2
return total
def main ():
print ("enter the length and breadth to find the area of rectangle")
l1 = input(int('enter the length:'))
l2 = input(int('enter the breadth'))
rectarea = arearectangle(l1, l2)
print("area of the rectangle is", rectarea)
print("enter the following values to obtain the area of square")
s1 = int(input('first side of square : intiger value :'))
areas = areasqr(s1)
print("Area of Square is ", areas)
print("enter the following value to find out the sum")
i = int(input('enter the first intiger : '))
j = int(input('enter the seoond intiger : '))
newtotal = addition(i, j)
print('the sum of the entered intger is ', newtotal)
if __name__ == '__main__':
main()
它会抛出以下错误:
File "", line 22, in main
l1 = input(int('enter the length:'))
ValueError: invalid literal for int() with base 10: 'enter the length:'
【问题讨论】:
-
什么错误....?
-
什么错误?请清楚地描述问题。阅读How to Ask 页面。
-
你看过你自己的问题了吗?如果是这样,你真的认为这是可以接受的吗?
-
进展如何?我的回答有用吗? :)