+ 2
Intermediate Python- 24.2 Practice help- “Define the methods”
Please help! Thanks! The given code takes 2 numbers as input and calls the static area() method of the Shape class, to output the area of the shape, which is equal to the height multiplied by the width. To make the code work, you need to define the Shape class, and the static area() method, which should return the multiplication of its two arguments. Code: w = int(input()) h = int(input()) print(Shape.area(w, h))
5 Respostas
+ 5
class Shape:
@staticmethod
def area(width,height):
return width * height
w = int(input())
h = int(input())
print(Shape.area(w, h))
+ 1
I think so ypu need to make area method
+ 1
Im not sure what to do next?
+ 1
✩✮★✮✩ , Simba , A͢J , JaScript , ChaoticDawg you have all been super helpful. Can anyone help here? Thaks!
+ 1
Thank you JaScript !!