How to end a block ? if and else


#1

It’s very simple, I’m supposed to enter :

  • if len(something) > 0 :
    print something
  • else :
    print “empty”

except I don’t know how to end the block “if” so that I can start the “else” one
it looks like this :

  • if len(something) > 0 :
    print something
    else :
    print “empty”

Can you help ?


#2

I suggest googling python if else, you’ll find many examples to refer to, and if you’re still left with questions that aren’t easily answered with a google search, go ahead and ask. Right now though, it looks like the information is already easily available to you.


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.