# def yildiz(level):
# for i in range(0,level):
# print(" " * (level-i), end="")
# print("*" * (2*i-1))
#
# yildiz(7)
class yildiz(object):
def __init__(self):
self.deger = 0
def show(self, sayi):
self.deger = sayi
for i in range(0, self.deger+1):
print(" " * (self.deger-i), end="")
print("*" * (2*i-1))
if __name__ == '__main__':
userInput = int(input("Deger: "))
result = yildiz()
result.show(userInput)
Hiç yorum yok:
Yorum Gönder