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
"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
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
"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
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
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
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
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
>
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
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
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
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
12 matches
Mail list logo