Hi There,
I am a little confused as to how this is False:
False==(False or True)
I would think it is True because False==False is true.
I think the parenthesis are confusing me.
(False==False) or True
This is True. Is it because False==False? And True==False is not True but that
does not
i=1
while i<=5:
print(i)
i=i+1
The result is:
1
2
3
4
5
Why is one of the results 5 since i=i+1? Should the maximum result be 4 since 4
+1=5?
Thanks for your help!
--
https://mail.python.org/mailman/listinfo/python-list
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
On Tuesday, June 21, 2016 at 11:59:37 PM UTC-4, Ben Finney wrote:
> Elizabeth Weiss > writes:
>
> > Hi There,
>
> Welcome! Your questions are fine here, but you may like to know that we
> also have a beginner-specific forum for collaborative tutoring
> https://mail.
On Tuesday, June 21, 2016 at 11:59:37 PM UTC-4, Ben Finney wrote:
> Elizabeth Weiss > writes:
>
> > Hi There,
>
> Welcome! Your questions are fine here, but you may like to know that we
> also have a beginner-specific forum for collaborative tutoring
> https://mail.
On Wednesday, June 22, 2016 at 3:15:02 AM UTC-4, Jussi Piitulainen wrote:
> Christian Gollwitzer writes:
>
> > Am 22.06.16 um 05:40 schrieb Elizabeth Weiss:
> >> I am a little confused as to how this is False:
> >>
> >> False==(False or True)
> >
On Wednesday, June 22, 2016 at 3:42:24 AM UTC-4, Lawrence D’Oliveiro wrote:
> On Wednesday, June 22, 2016 at 3:40:22 PM UTC+12, Elizabeth Weiss wrote:
> > I am a little confused as to how this is False:
> >
> > False==(False or True)
> >
> > I would think it is
On Wednesday, June 22, 2016 at 11:59:44 PM UTC-4, Steven D'Aprano wrote:
> On Thu, 23 Jun 2016 01:12 pm, Larry Hudson wrote:
>
> > On 06/22/2016 12:42 AM, Lawrence D’Oliveiro wrote:
> > [snip]
> >> I feel that’s a needlessly complicated rule. It would have been simpler
> >> if boolean operators (a
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("Bre
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:
> >
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")
> &g
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
Hi There,
What is the point of this code?:
word=[]
print(word)
The result is []
When would I need to use something like this?
Thank you!
--
https://mail.python.org/mailman/listinfo/python-list
I understand this code:
words=["hello", "world", "spam", "eggs"]
for words in words
print(word + "!")
What I do not understand is:
words=["hello", "world", "spam", "eggs"]
counter=0
max_index=len(words)-1
while counter<=max_index:
word=words[counter]
print(word + "!")
counter=counte
while True:
print("Options:")
print("Enter 'add' to add two numbers")
print("Enter 'subtract' to subtract two numbers")
print("Enter 'multiply' to multiply two numbers")
print("Enter 'divide' to divide two numbers")
print("Enter 'quit' to end the prog
15 matches
Mail list logo