by Anonymous » 13 Feb 2025, 23:01
Gibt es eine Bedeutung für die Eindrücke beim Aufbrechen einer Linie (mit Backslash oder Klammern) in Python? Wie wäre es mit der Stilempfehlung, die empfohlen wird?
Code: Select all
def print_empty_square(size, c):
for row in range(size):
for col in range(size):
if (row == 0 or row == size -1
or col == 0 or col == size -1):
print(c,end = "")
else:
print(' ',end = "")
print()
< /code>
def print_empty_square(size, c):
for row in range(size):
for col in range(size):
if (row == 0 or row == size -1
or col == 0 or col == size -1):
print(c,end = "")
else:
print(' ',end = "")
print()
Ich habe beide Codes ausprobiert, beide rennen erfolgreich.
Gibt es eine Bedeutung für die Eindrücke beim Aufbrechen einer Linie (mit Backslash oder Klammern) in Python? Wie wäre es mit der Stilempfehlung, die empfohlen wird?[code]def print_empty_square(size, c):
for row in range(size):
for col in range(size):
if (row == 0 or row == size -1
or col == 0 or col == size -1):
print(c,end = "")
else:
print(' ',end = "")
print()
< /code>
def print_empty_square(size, c):
for row in range(size):
for col in range(size):
if (row == 0 or row == size -1
or col == 0 or col == size -1):
print(c,end = "")
else:
print(' ',end = "")
print()
[/code]
Ich habe beide Codes ausprobiert, beide rennen erfolgreich.