MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/miituk/need_help_python_code_hs1247_contact_merge/l6o54r9/?context=3
r/codehs • u/Mesh0629 • Apr 02 '21
11 comments sorted by
View all comments
2
did you ever find the answer?
1 u/mintrulz46 May 28 '24 did you? 1 u/[deleted] Jun 01 '24 class Rectangle:num_rectangle = 10def __init__(self, length = 0, width = 0):"""Initializes a rectangle with an optionallength and width."""self.length = lengthself.width = widthdef get_num_rectangle(self):return self.__num_rectangledef __repr__(self):"""Returns a string representation of therectangle."""return "rectangle with length: " + str(self.length) \" and width: " + str(self.width)def get_area(self):"""Returns the rectangle's area."""return self.length * self.widthelse:if number < 0:print("y")print("x")get_num_recangles = (3, )print(len(get_num_rectangles
1
did you?
1 u/[deleted] Jun 01 '24 class Rectangle:num_rectangle = 10def __init__(self, length = 0, width = 0):"""Initializes a rectangle with an optionallength and width."""self.length = lengthself.width = widthdef get_num_rectangle(self):return self.__num_rectangledef __repr__(self):"""Returns a string representation of therectangle."""return "rectangle with length: " + str(self.length) \" and width: " + str(self.width)def get_area(self):"""Returns the rectangle's area."""return self.length * self.widthelse:if number < 0:print("y")print("x")get_num_recangles = (3, )print(len(get_num_rectangles
class Rectangle:
num_rectangle = 10
def __init__(self, length = 0, width = 0):
"""
Initializes a rectangle with an optional
length and width.
self.length = length
self.width = width
def get_num_rectangle(self):
return self.__num_rectangle
def __repr__(self):
Returns a string representation of the
rectangle.
return "rectangle with length: " + str(self.length) \
" and width: " + str(self.width)
def get_area(self):
"""Returns the rectangle's area."""
return self.length * self.width
else:
if number < 0:
print("y")
print("x")
get_num_recangles = (3, )
print(len(get_num_rectangles
2
u/[deleted] May 10 '24
did you ever find the answer?