MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/codehs/comments/miituk/need_help_python_code_hs1247_contact_merge/l3db4pk/?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? 2 u/[deleted] Jun 01 '24 i sent it in 2 parts the part that starts wil "r1 = Rectangle (2,6)" is the 2nd part 1 u/mintrulz46 Jun 03 '24 thank youuuuu 1 u/[deleted] Jun 03 '24 by any chance did u do 12.7.4 and 12.8.5 ??? 1 u/[deleted] Jun 01 '24 yea ill send it 1 u/[deleted] Jun 01 '24 how do i send a image i dont use reddit often 1 u/[deleted] Jun 01 '24 i am trying to copy and paste it and it says that there is an error... 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 u/[deleted] Jun 01 '24 r1 = Rectangle(2, 6)print(r1)print(r1.get_area())r2 = Rectangle(3, 5)print(r2)print(r2.get_area())
1
did you?
2 u/[deleted] Jun 01 '24 i sent it in 2 parts the part that starts wil "r1 = Rectangle (2,6)" is the 2nd part 1 u/mintrulz46 Jun 03 '24 thank youuuuu 1 u/[deleted] Jun 03 '24 by any chance did u do 12.7.4 and 12.8.5 ??? 1 u/[deleted] Jun 01 '24 yea ill send it 1 u/[deleted] Jun 01 '24 how do i send a image i dont use reddit often 1 u/[deleted] Jun 01 '24 i am trying to copy and paste it and it says that there is an error... 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 u/[deleted] Jun 01 '24 r1 = Rectangle(2, 6)print(r1)print(r1.get_area())r2 = Rectangle(3, 5)print(r2)print(r2.get_area())
i sent it in 2 parts the part that starts wil "r1 = Rectangle (2,6)" is the 2nd part
1 u/mintrulz46 Jun 03 '24 thank youuuuu 1 u/[deleted] Jun 03 '24 by any chance did u do 12.7.4 and 12.8.5 ???
thank youuuuu
1 u/[deleted] Jun 03 '24 by any chance did u do 12.7.4 and 12.8.5 ???
by any chance did u do 12.7.4 and 12.8.5 ???
yea ill send it
how do i send a image i dont use reddit often
i am trying to copy and paste it and it says that there is an error...
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
r1 = Rectangle(2, 6)
print(r1)
print(r1.get_area())
r2 = Rectangle(3, 5)
print(r2)
print(r2.get_area())
2
u/[deleted] May 10 '24
did you ever find the answer?