does \n only generate a separate line when used in the print() function? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
+ 1

does \n only generate a separate line when used in the print() function?

Or is it supposed to create a separate line when used in a string as well?

30th Sep 2016, 3:05 AM
samuel wall
1 Réponse
+ 8
You can also code "\n" in strings. Example: X = "This \n and this \n and this will be printed in seperate lines"
30th Sep 2016, 2:37 PM
Christine Fleming (PyGirl)
Christine Fleming (PyGirl) - avatar