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 you tried putting the 'if' statement inside the 'while' loop?
> 
> If not, give it a shot and see what happens.
> 
> Frank Millman

I tried this :

count = 0

while count < 10:
  if count < 5:
  print "Hello, I am an if statement and count is",   count
  print "Hello, I am a while and count is", count
  count += 1

but it gives an "indentation error: expected an indented block" with an arrow 
pointing at the count after the 3rd statement. Indentation error is supposed to 
be an error about tabs and spaces right ? But I can't find any mistakes with it 
...
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to