#1
  1. No Profile Picture
    Registered User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Nov 2012
    Posts
    6
    Rep Power
    0

    Explanation of a certain command in python


    Can anyone explain what the command !="": means in python? Thanks
  2. #2
  3. Contributing User
    Devshed Demi-God (4500 - 4999 posts)

    Join Date
    Aug 2011
    Posts
    4,996
    Rep Power
    481
    Python consists of tokens, expressions and statements. What is a "command"?

    Now, you might see in code
    Code:
    if my_string != "":
        block
    meaning "if the content of the variable my_string is not equal to the empty string then execute the statements indented in block".

    The tokens are
    `if' `my_string' `!=' `""' `:'
    and the conditional expression is
    my_string != ""
    [code]Code tags[/code] are essential for python code and Makefiles!

IMN logo majestic logo threadwatch logo seochat tools logo