Coming soon - Get a detailed view of why an account is flagged as spam!
view details

This post has been de-listed

It is no longer included in search results and normal feeds (front page, hot posts, subreddit posts, etc). It remains visible only via the author's post history.

2
Can anyone help me out with this error please
Post Body

In this problem I am tasked with writing a program to find the area of a trapezoid. Can anyone tell me what this error means and how to fix it? I guess itโ€™s something to do with the formatting of the area formula but I canโ€™t figure out how to fix it. Thanks guys def problem1_7(): b1 = input("Enter the value of base 1: ") b2 = input("Enter the value of base 2: ") h = input("Enter the height: ") area = int((1/2)(b1 b2)h) print("The area of a trapezoid with bases",b1,b2,"and",h,"is",area )

problem1_7()

Enter the value of base 1: 3

Enter the value of base 2: 4

Enter the height: 8 Traceback (most recent call last):

File "<ipython-input-72-45c1a3480d6b>", line 1, in <module> problem1_7()

File "<ipython-input-71-3ff2361ff4f6>", line 5, in problem1_7 area = int((1/2)(b1 b2)h)

TypeError: can't multiply sequence by non-int of type 'float'

Author
Account Strength
80%
Account Age
6 years
Verified Email
Yes
Verified Flair
No
Total Karma
225
Link Karma
81
Comment Karma
144
Profile updated: 4 days ago
Posts updated: 1 day ago

Subreddit

Post Details

We try to extract some basic information from the post title. This is not always successful or accurate, please use your best judgement and compare these values to the post title and body for confirmation.
Posted
5 years ago