Dec-16-2020, 12:01 PM
I want to write a program that gives the following outputs with the Python while loop.
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
I can't find a way how to do it.
1 2 3 4 5
1 2 3 4
1 2 3
1 2
1
I can't find a way how to do it.
while loop
|
Dec-16-2020, 12:01 PM
I want to write a program that gives the following outputs with the Python while loop.
1 2 3 4 5 1 2 3 4 1 2 3 1 2 1 I can't find a way how to do it.
Dec-16-2020, 12:07 PM
what have you tried so far?
(Dec-16-2020, 12:07 PM)Larz60+ Wrote: what have you tried so far? a=1 while(True): a+=1 print(a) breakI know this is not the correct answer. But how should I write here so that I can find the correct answer. Larz60+ write Dec-16-2020, 06:35 PM:
Please post all code, output and errors (it it's entirety) between their respective tags. Refer to BBCode help topic on how to post. Use the "Preview Post" button to make sure the code is presented as you expect before hitting the "Post Reply/Thread" button. Fixed for you this time. Please use bbcode tags on future posts.
Dec-16-2020, 02:44 PM
First write the steps out in English. Then try coding each step. Think about how you would use loops to accomplish your task.
|
|