Re: [Tutor] Differences between while and for

2019-06-15 Thread Alan Gauld via Tutor
On 15/06/2019 05:53, mhysnm1...@gmail.com wrote: > In C, Perl and other languages. As a point of interest not all languages have these constructs. Oberon, for example, only has a while loop because it can be used to simulate all other loop types. Some Lisp dialects don't even have a loop constru

Re: [Tutor] Differences between while and for

2019-06-15 Thread Cameron Simpson
On 15Jun2019 14:53, Sean Murphy wrote: In C, Perl and other languages. While only uses a conditional statement and for uses an iteration. In python while and for seems to be the same and I cannot see the difference. No, they're really much as in other languages. In general (most languages),

Re: [Tutor] Differences between while and for

2019-06-15 Thread Steven D'Aprano
On Sat, Jun 15, 2019 at 02:53:43PM +1000, mhysnm1...@gmail.com wrote: > All, > > > > In C, Perl and other languages. While only uses a conditional statement and > for uses an iteration. In python while and for seems to be the same and I > cannot see the difference. Python ``while`` uses a cond

[Tutor] Differences between while and for

2019-06-14 Thread mhysnm1964
All, In C, Perl and other languages. While only uses a conditional statement and for uses an iteration. In python while and for seems to be the same and I cannot see the difference. Python does not have an until (do while) where the test is done at the end of the loop. Permitting a once through