How do you delete the last "*" in this array? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
8th Jun 2023, 2:57 AM
Jestoni Zamora Macasohol
Jestoni Zamora Macasohol - avatar
3 Réponses
+ 4
You cannot "delete" what you have already printed to the screen (at least not on Sololearn). You print the * character less times than the number. So you need to write a condition (if) to track the loop variable, and only print the sign when it's not the last element.
8th Jun 2023, 3:53 AM
Tibor Santa
Tibor Santa - avatar
+ 5
ty Prasant for helping and Tibor Santa for clarification
8th Jun 2023, 4:15 AM
Jestoni Zamora Macasohol
Jestoni Zamora Macasohol - avatar