How do I do this? | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
0

How do I do this?

How do I make print ("insert something") print each string at a time?

6th May 2024, 8:13 PM
Blu Clark
Blu Clark - avatar
4 Respuestas
+ 2
For loop. They work like this. for element in iterable: doThing(element) You put the strings in an iterable like a list or a tuple. If you just want to print multiple lines, though, you might just add \n escape sequences to the string.
6th May 2024, 10:28 PM
Wilbur Jaywright
Wilbur Jaywright - avatar
+ 2
if you want each word, you can use split()
7th May 2024, 1:28 AM
Bob_Li
Bob_Li - avatar
+ 1
Blu Clark you mean to print each character of a string one at a time, right; you can achieve this using a loop with a delay.
7th May 2024, 1:01 AM
`нттየ⁴⁰⁶
`нттየ⁴⁰⁶ - avatar
0
Do you mean a list of strings or a line for each character ?
8th May 2024, 5:29 PM
Heather Ambrosio
Heather Ambrosio - avatar