+ 1

Python

Write a python program that uses a while loop to read through a string and print the characters of the string one by one on a separate lines

15th Nov 2019, 2:56 PM
Alshaqsia Alshaqsi
Alshaqsia Alshaqsi - avatar
3 Respostas
+ 6
Bro first try yourself, it will improve your logical thinking skill. If facing any problem than post your code along with your question. All the best!!
15th Nov 2019, 3:20 PM
Nitin Tiwari
Nitin Tiwari - avatar
+ 4
That’s going to be an infinite loop. First of all, computers start counting at 0, so i needs to equal 0. Second, i never changes. So after your print function, you will need to add 1 to i
15th Nov 2019, 4:15 PM
Jax
Jax - avatar
0
x=input(“Enter a string:”) i=1 while i<len(x): print(x[i])
15th Nov 2019, 3:37 PM
Alshaqsia Alshaqsi
Alshaqsia Alshaqsi - avatar