We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 0df445a commit f83b4baCopy full SHA for f83b4ba
1 file changed
Level_02/diamond.py
@@ -0,0 +1,13 @@
1
+max_width = int(input("Maximale Breite: "))
2
+min_width = 0
3
+zeichen = input("Zeichen: ")
4
+assert len(zeichen) == 1
5
+
6
+cur_width = 1
7
+while cur_width * 2 <= max_width:
8
+ print(" " * (max_width - cur_width) + zeichen*(cur_width * 2 - 1))
9
+ cur_width += 1
10
11
+while cur_width * 2 >= min_width:
12
13
+ cur_width -= 1
0 commit comments