Re: While, If, Count Statements

2017-11-28 Thread Cai Gengyang
On Tuesday, November 28, 2017 at 8:12:09 PM UTC+8, Frank Millman wrote: > "Cai Gengyang" wrote in message > news:a8335d2c-1fb9-4ba9-b752-418d19e57...@googlegroups.com... > > > > On Tuesday, November 28, 2017 at 4:18:04 PM UTC+8, Frank Millman wrote: > > > "Cai Gengyang" wrote in message > > > ne

Re: While, If, Count Statements

2017-11-28 Thread Frank Millman
"Cai Gengyang" wrote in message news:a8335d2c-1fb9-4ba9-b752-418d19e57...@googlegroups.com... On Tuesday, November 28, 2017 at 4:18:04 PM UTC+8, Frank Millman wrote: > "Cai Gengyang" wrote in message > news:c2dfc9c4-3e16-480c-aebf-553081775...@googlegroups.com... > > > Sure, so how would the c

Re: While, If, Count Statements

2017-11-28 Thread Cai Gengyang
On Tuesday, November 28, 2017 at 4:18:04 PM UTC+8, Frank Millman wrote: > "Cai Gengyang" wrote in message > news:c2dfc9c4-3e16-480c-aebf-553081775...@googlegroups.com... > > > Sure, so how would the code look like if I want the "if" statement to be > > nested inside the "while" loop > > Have y

Re: While, If, Count Statements

2017-11-28 Thread Frank Millman
"Cai Gengyang" wrote in message news:c2dfc9c4-3e16-480c-aebf-553081775...@googlegroups.com... Sure, so how would the code look like if I want the "if" statement to be nested inside the "while" loop Have you tried putting the 'if' statement inside the 'while' loop? If not, give it a shot and

Re: While, If, Count Statements

2017-11-28 Thread Cai Gengyang
On Tuesday, November 28, 2017 at 6:09:17 AM UTC+8, Ned Batchelder wrote: > On 11/27/17 7:54 AM, Cai Gengyang wrote: > > Input : > > > > count = 0 > > > > if count < 5: > >print "Hello, I am an if statement and count is", count > > > > while count < 10: > >print "Hello, I am a while and coun

While, If, Count Statements

2017-11-27 Thread nospam . Cai Gengyang
Input : count = 0 if count < 5: print "Hello, I am an if statement and count is", count while count < 10: print "Hello, I am a while and count is", count count += 1 Output : Hello, I am an if statement and count is 0 Hello, I am a while and count is 0 Hello, I am a while and count is 1

Re: While, If, Count Statements

2017-11-27 Thread nospam . Ned Batchelder
On 11/27/17 7:54 AM, Cai Gengyang wrote: > Input : > > count = 0 > > if count < 5: >print "Hello, I am an if statement and count is", count > > while count < 10: >print "Hello, I am a while and count is", count >count += 1 > > Output : > > Hello, I am an if statement and count is 0 > He

Re: While, If, Count Statements

2017-11-27 Thread nospam . bartc
On 27/11/2017 12:54, Cai Gengyang wrote: > > Input : > > count = 0 > > if count < 5: >print "Hello, I am an if statement and count is", count > > while count < 10: >print "Hello, I am a while and count is", count >count += 1 > > Output : > > Hello, I am an if statement and count is 0 >

Re: While, If, Count Statements

2017-11-27 Thread Stefan Ram
Cai Gengyang writes: Statement 0: >count = 0 Statement 1: >if count < 5: > print "Hello, I am an if statement and count is", count Statement 2: >while count < 10: > print "Hello, I am a while and count is", count > count += 1 There are three statements here. They are executed

Re: While, If, Count Statements

2017-11-27 Thread Ned Batchelder
On 11/27/17 7:54 AM, Cai Gengyang wrote: Input : count = 0 if count < 5: print "Hello, I am an if statement and count is", count while count < 10: print "Hello, I am a while and count is", count count += 1 Output : Hello, I am an if statement and count is 0 Hello, I am a while and c

Re: While, If, Count Statements

2017-11-27 Thread bartc
On 27/11/2017 12:54, Cai Gengyang wrote: Input : count = 0 if count < 5: print "Hello, I am an if statement and count is", count while count < 10: print "Hello, I am a while and count is", count count += 1 Output : Hello, I am an if statement and count is 0 Hello, I am a while and

While, If, Count Statements

2017-11-27 Thread Cai Gengyang
Input : count = 0 if count < 5: print "Hello, I am an if statement and count is", count while count < 10: print "Hello, I am a while and count is", count count += 1 Output : Hello, I am an if statement and count is 0 Hello, I am a while and count is 0 Hello, I am a while and count is 1