Continuous output without newline character ... | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Continuous output without newline character ...

The code: j=0 while j<5: print(j) This prints the value of j then a newline character. Is there a way to not print the newline character?

15th Sep 2019, 2:26 PM
GeoK68
GeoK68 - avatar
1 Antwort
+ 4
print(j, end="") By default, end is equal to "/n", which is the newline character, so you just have to change it to an empty string
15th Sep 2019, 2:30 PM
Aymane Boukrouh
Aymane Boukrouh - avatar