Continuous output without newline character ... | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
+ 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