Free Trial

Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.

  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

B. Python Keywords

Appendix B. Python Keywords

Keywords in Python (and in most programming languages) are words that have special meaning. They are used as part of the programming language itself, and therefore must not be used for anything else. For example, if you try to use keywords as variables, or use them in the wrong way, you will get strange (sometimes funny, sometimes confusing) error messages from the Python console.

This appendix describes each of the Python keywords. You should find this to be a handy reference as you continue to program.

and

The keyword and is used to join two expressions together in a statement (like an if statement) to say that both expressions must be true. Here’s an example:

if age > 10 and age < 20:
    print('Beware the teenager!!!!')

  

You are currently reading a PREVIEW of this book.

                                                                                                                    

Get instant access to over $1 million worth of books and videos.

  

Start a Free Trial


  
  • Safari Books Online
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint