Glavni problem je što funkcija print() ispisuje jedan po red. Ako želite ispisati više redova, trebate koristiti drugu funkciju, kao što je printf().
There are a few ways to print multiple lines in one line in Python. One way is to use the print function with the end parameter set to an empty string:
print("Line 1", end="") print("Line 2")
Another way is to use the print function with the sep parameter set to an empty string:
print("Line 1", "Line 2", sep="")
Red 1 će biti odštampan, a zatim red 2 u istom redu.
Rad sa linijama
U Pythonu, linije su predstavljene nizom ”
“. Linije se mogu koristiti u različite svrhe, kao što je odvajanje iskaza u skripti ili podataka u datoteci.