Wie mache ich ein Dreieck von X in Python?

Post a reply

Smilies
:) :( :oops: :chelo: :roll: :wink: :muza: :sorry: :angel: :read: *x) :clever:
View more smilies

BBCode is ON
[img] is ON
[flash] is OFF
[url] is ON
Smilies are ON

Topic review
   

Expand view Topic review: Wie mache ich ein Dreieck von X in Python?

by Anonymous » 10 Feb 2025, 17:44

Wie würde ich eine Funktion schreiben, die ein solches Dreieck erzeugt: < /p>

Code: Select all

    x
xx
xxx
xxxx
xxxxx
Nehmen wir an, die Funktion ist def driantle (n) >
Ich weiß nur, wie man ein Box erstellt: < /p>

Code: Select all

n = 5
for k in range(n):
for j in range(n):
print('x', end='')
print()

Top