okay and last question i won’t pester you any longer but, is this project suppose to be hard, i don’t see many people on the forum opening topics about it recently, i feel like a total dummy.
You’re learning programming on your own, it’s hard and it will often be humbling. Everyone feels like that. Anyone who is flying through this and feels smart isn’t learning anything.
It’s good to feel dumb, that means you’re challenging yourself and you are learning. Learn to love that feeling.
i don’t get this whole concept of takes another shape for example
get_picture: Returns a string that represents the shape using lines of ‘'. The number of lines should be equal to the height and the number of '’ in each line should be equal to the width. There should be a new line (\n) at the end of each line. If the width or height is larger than 50, this should return the string: 'Too big for picture.'.
get_amount_inside: Takes another shape (square or rectangle) as an argument. Returns the number of times the passed in shape could fit inside the shape (with no rotations). For instance, a rectangle with a width of 4 and a height of 8 could fit in two squares with sides of 4.
this step i have no idea what to do other then an if statement self.width is > self.height for the first type, i don’t understand what it means by" a shape" in the first and second step. In the first step i don’t understand the whole return a string idea it mentions at the beginning
my code so far
class Rectangle:
def __init__(self,width,height):
self.width = width
self.height = height
def set_width():
pass
def set_height():
pass
def get_area():
return self.width * self.height
def get_perimeter():
return 2 * width + 2 * height
def get_diagonal():
return (width ** 2 + height ** 2) ** .5
def get_picture():
if self.width > 50 or self.height > 50:
return 'Too big for picture.'
s = '*'
for i in range (1,6):
print(*s * 5)
def get_amount_inside():
pass
class Square(Rectangle):
def __init__(self,square):
super().__init__(square,square)
the rectangle of asterisks, the one described in the text you copied from the project
get_picture : Returns a string that represents the shape using lines of * The number of lines should be equal to the height and the number of * in each line should be equal to the width. There should be a new line (\n ) at the end of each line.
there is no self.length, you just have your s, and you want to create a row of asterisk so that the number of asterisks is equal to the width of the rectangle. You need to do a small change to this that you wrote earlier