Yay !

On Sunday, August 14, 2016 at 1:40:09 AM UTC+8, Chris Angelico wrote:
> On Sun, Aug 14, 2016 at 3:06 AM, Cai Gengyang <gengyang...@gmail.com> wrote:
> > Oh ok, so for the first block , it works because the indentation is the 
> > same for all 3 "print" statements , i.e. the indentation is 4 spaces for 
> > each of the 3 print statements.
> >
> > if a == 1:
> >     print("If a is one, this will print.")
> >     print("So will this.")
> >     print("And this.")
> >
> > print("This will always print because it is not indented.")
> >
> > For the 2nd block of code, it doesn't work because the indentation is 
> > different, 2 spaces for the first statement, 5 for the 2nd statement and 4 
> > for the 3rd statement.
> >
> > if a == 1:
> >   print("Indented two spaces.")
> >      print("Indented four. This will generate an error.")
> >     print("The computer will want you to make up your mind.")
> >
> > Am i correct ?
> 
> Yep! That's correct.
> 
> ChrisA

-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to