On Thursday, June 23, 2016 at 12:17:23 AM UTC-4, Elizabeth Weiss wrote:
> CODE #1:
>
> i=0
> while 1==1:
>print(i)
>i=i+1
>if i>=5:
> print("Breaking")
> break
>
> --
> I understand that i=0 and i will only be printed if 1=1
> The results of this is
> 0
> 1
> 2
> 3
> 4
>
On Thursday, June 23, 2016 at 1:20:37 AM UTC-4, DFS wrote:
> On 6/23/2016 12:17 AM, Elizabeth Weiss wrote:
>
> > CODE #1:
> >
> > i=0
> > while 1==1:
> >print(i)
> >i=i+1
> >if i>=5:
> > print("Breaking")
> > break
> >
> > --
> > I understand that i=0 and i will only be p
On Thursday, June 23, 2016 at 1:06:09 AM UTC-4, Rustom Mody wrote:
> On Thursday, June 23, 2016 at 9:47:23 AM UTC+5:30, Elizabeth Weiss wrote:
> > CODE #1:
> >
> > i=0
> > while 1==1:
> >print(i)
> >i=i+1
> >if i>=5:
> > print("Breaking")
> > break
> >
> > --
> > I under
On Thursday, June 23, 2016 at 12:49:30 AM UTC-4, Lawrence D’Oliveiro wrote:
> On Thursday, June 23, 2016 at 4:17:23 PM UTC+12, Elizabeth Weiss wrote:
> >
> > i=0
> > while 1==1:
> >print(i)
> >i=i+1
> >if i>=5:
> > print("Breaking")
> > break
> >
> > Why is Breaking going to
On Sun, 26 Jun 2016 05:32 pm, Lawrence D’Oliveiro wrote:
> On Thursday, June 23, 2016 at 11:58:01 PM UTC+12, Jon Ribbens wrote:
>> I seem to recall that Java originally insisted that only booleans
>> (excluding even Booleans, which are a different thing because of
>> course they are) could be chec
On Thursday, June 23, 2016 at 11:58:01 PM UTC+12, Jon Ribbens wrote:
> I seem to recall that Java originally insisted that only booleans
> (excluding even Booleans, which are a different thing because of
> course they are) could be checked for truth and it was one of
> Java's significant warts.
Ja
BartC wrote:
> But even with ordinary conditionals, False is False, but [False] is
> True. And [] is False, while [[]] is True. A class instance is always
> True, even when empty. And then "False" is True as well!
"Empty" is not "Nothing". To be empty, something must exist first.
--
Pierre-Al
In <639b00e0-7b9d-4ed4-96ad-6afbcd536...@googlegroups.com> Elizabeth Weiss
writes:
> i=0
> while 1==1:
>print(i)
>i=i+1
>if i>=5:
> print("Breaking")
> break
> Why is Breaking going to be printed if i only goes up to 4?
Your code prints i and THEN adds one to it.
So i is
On Fri, Jun 24, 2016 at 1:52 AM, BartC wrote:
> On 23/06/2016 12:39, Chris Angelico wrote:
>>
>> On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote:
>>>
>>> Actually pretty much any expression can be used, because Python can
>>> interpret almost anything as either True or False. Don't ask for the
>>> r
On 23/06/2016 12:39, Chris Angelico wrote:
On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote:
Actually pretty much any expression can be used, because Python can
interpret almost anything as either True or False. Don't ask for the rules
because they can be complicated, but for example, zero is False
On 2016-06-23, Chris Angelico wrote:
> On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote:
>> Actually pretty much any expression can be used, because Python can
>> interpret almost anything as either True or False. Don't ask for the rules
>> because they can be complicated, but for example, zero is Fa
On Thu, Jun 23, 2016 at 8:15 PM, BartC wrote:
> Actually pretty much any expression can be used, because Python can
> interpret almost anything as either True or False. Don't ask for the rules
> because they can be complicated, but for example, zero is False, and any
> other number is True. I thin
On 23/06/2016 05:17, Elizabeth Weiss wrote:
CODE #1:
i=0
while True:
i=i+1
if i==2:
print("Skipping 2")
continue
if i==5:
print("Breaking")
break
print(i)
--
Questions:
2. i=i+1- I never understand this. Why isn't it i=i+2?
3. Do the results not include 2 of
On Wed, 22 Jun 2016 21:17:03 -0700, Elizabeth Weiss wrote:
> CODE #1:
>
> i=0 while 1==1:
>print(i)
>i=i+1 if i>=5:
> print("Breaking") break
>
> --
> I understand that i=0 and i will only be printed if 1=1 The results of
> this is 0
> 1
> 2
> 3
> 4
> Breaking
>
> Why is Breaki
On Thursday 23 June 2016 14:17, Elizabeth Weiss wrote:
> CODE #2:
>
> i=0
> while True:
>i=i+1
> if i==2:
> print("Skipping 2")
> continue
> if i==5:
> print("Breaking")
> break
>print(i)
>
> --
>
> Questions:
> 1. what does the word True have to do with anyt
On Thursday, June 23, 2016 at 9:47:23 AM UTC+5:30, Elizabeth Weiss wrote:
> CODE #1:
>
> i=0
> while 1==1:
>print(i)
>i=i+1
>if i>=5:
> print("Breaking")
> break
>
> --
> I understand that i=0 and i will only be printed if 1=1
> The results of this is
> 0
> 1
> 2
> 3
> 4
On Thursday, June 23, 2016 at 4:17:23 PM UTC+12, Elizabeth Weiss wrote:
>
> i=0
> while 1==1:
>print(i)
>i=i+1
>if i>=5:
> print("Breaking")
> break
>
> Why is Breaking going to be printed if i only goes up to 4? It does say if
> i>=5?
Because you incremented i after printi
CODE #1:
i=0
while 1==1:
print(i)
i=i+1
if i>=5:
print("Breaking")
break
--
I understand that i=0 and i will only be printed if 1=1
The results of this is
0
1
2
3
4
Breaking
Why is Breaking going to be printed if i only goes up to 4? It does say if
i>=5? Shouldn't this me
18 matches
Mail list logo