[Tutor] Else vs. Continue

2013-11-24 Thread Rafael Knuth
Hej there, I stumbled upon the continue statement and to me it looks like it does exactly the same as else. I tested both else and continue in a little program and I don't see any differences between both. Is my assumption correct or wrong? If the latter is the case: Can you give me examples of

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Dominik George
Hi, I stumbled upon the continue statement and to me it looks like it does exactly the same as else. I tested both else and continue in a little program and I don't see any differences between both. Is my assumption correct or wrong? If the latter is the case: Can you give me examples of

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Joel Goldstick
On Sun, Nov 24, 2013 at 4:41 PM, Dominik George n...@naturalnet.de wrote: Hi, I stumbled upon the continue statement and to me it looks like it does exactly the same as else. I tested both else and continue in a little program and I don't see any differences between both. Is my assumption

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Alan Gauld
On 24/11/13 21:32, Rafael Knuth wrote: I stumbled upon the continue statement and to me it looks like it does exactly the same as else. I tested both else and continue in a little program and I don't see any differences between both. for num in range(2,10): if num % 2 == 0:

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Alan Gauld
On 24/11/13 22:38, Alan Gauld wrote: Responding to my own post, never a good sign :-( primes = [] for n in range(1000) if n%2 == 0: even numbers aren't prime continue else: if isPrime(n): primes.append(n) Now the continue means the isPrime test never gets

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Mark Lawrence
On 24/11/2013 21:41, Dominik George wrote: Hi, I stumbled upon the continue statement and to me it looks like it does exactly the same as else. I tested both else and continue in a little program and I don't see any differences between both. Is my assumption correct or wrong? If the latter is

Re: [Tutor] Else vs. Continue

2013-11-24 Thread Steven D'Aprano
On Sun, Nov 24, 2013 at 10:32:20PM +0100, Rafael Knuth wrote: Hej there, I stumbled upon the continue statement and to me it looks like it does exactly the same as else. I tested both else and continue in a little program and I don't see any differences between both. continue and else are