Versuche mit Assignment Expressions.

This commit is contained in:
Olli Graf
2024-06-19 12:03:53 +02:00
parent 432e73375a
commit 0c76dc11d7
2 changed files with 20 additions and 0 deletions

10
walross/simple_loop.py Normal file
View File

@@ -0,0 +1,10 @@
# Ohne Walross-Operator
n = 0
while n < 10:
n += 1
print(n)
# Mit Walross-Operator
n = 0
while (n := n + 1) < 10:
print(n)