I don't really know what I'm doing, the only successful classes I've written have been in Java. I can't seem to get this code to work. It keeps giving me 'small_box is not defined' along with 'stars_stripes = StarsAndStripes()' and no explanation on the second traceback.
class StarsAndStripes():
def __init__(self):
self.small_box = small_box()
self.big_box = big_box()
def twenty_stars():
for i in range(20):
print("*")
print("\n")
def twenty_dashes():
for i in range(20):
print("-")
print("\n")
def small_box():
for i in range(3):
print(twenty_dashes)
print(twenty_stars)
print(twenty_dashes)
def big_box():
print(small_box)
print(small_box)
stars_stripes = StarsAndStripes()
print(stars_stripes.small_box)
print("\n\n")
print(stars_stripes.big_box)
The result should look something like this:
--------------------
********************
--------------------
********************
--------------------
********************
--------------------
--------------------
********************
--------------------
********************
--------------------
********************
--------------------
--------------------
********************
--------------------
********************
--------------------
********************
--------------------