+ 7
Christian Huml , it is not quite clear for me what you want to achieve with your code. maybe this example can help you. we use a range() object starting from 0 upto 1000, generating numbers in a step of 100: for num in range(0,1000,100): print(num)
9th Mar 2022, 7:19 PM
Lothar
Lothar - avatar
+ 3
You start with 0 as starting value, the condition returns true so it adds 100 to A, 0+100 = 100, prints the value of A, checks the condition again, which returns false this time since value of a is higher than 5. And it exits the loop.
9th Mar 2022, 6:42 PM
Aleksandar Aleksovski
Aleksandar Aleksovski - avatar
+ 2
G'day Christian Huml congratulations on getting the code to do what you wanted. Do you love the way Python can do some things so much easier than older languages? Would you do a bit of housekeeping, edit your original post to start with [Solved]? Have you found the Q&A search bar (it is the magnifying glass icon at the top of the discuss screen)? Did you know you can link other Q&A posts or SoloLearn code bits (use the plus icon)? https://www.sololearn.com/discuss/1316935/?ref=app
9th Mar 2022, 7:40 PM
HungryTradie
HungryTradie - avatar
+ 1
https://code.sololearn.com/ccMBR97Pj46J/?ref=app
9th Mar 2022, 6:50 PM
Ion Kare
Ion Kare - avatar
+ 1
A=0 while (A<=10000): A += 100 print(A) //prints 100-10000
9th Mar 2022, 7:11 PM
Hritik