In this video, Jennifer Harrison discusses the reserved words in Python. Learn how to view a complete list of reserved words and where to get help on those keywords.
- [Instructor] There are a set of reserved words in Python…and sets of reserved words in each of…the modules that you import into Python.…These words all have special meaning.…I'll show you how to get a list of these…reserved words so that you don't use them as variable names,…and I'll also show you how to get help on these words.…I'm in idle, in a shell window.…A list of reserved words can be seen in this shell window…by using the dir command.…
With dir you pass to it the word builtins…inside parenthesis and there are two underscores…before and after the word builtins.…It's kind of strange but that's how it is.…So when you type dir builtins you get a list of all of the…builtin words that are part of the core of Python.…Some of the reserved words are written in all lowercase…like this word raw_input, which stops the script and asks…the user to input something.…
While others have uppercase letters at the beginning…of each word as in this one called…RuntimeError.…There's no way to know exactly how these keywords are…
- Writing and running Python scripts in IDLE
- Making scripts flexible with variables
- Commenting scripts
- Manipulating string data
- Object-oriented programming in Python
- Creating loops
- Reading and writing text files
- Capturing input at runtime
- Documenting your scripts
Skill Level Beginner
1. Python for ArcGIS Basics
2. Strings, Numbers, and Variables
Work with numeric values5m 22s
3. Syntax Rules
4. Manipulating Strings
5. Object-Oriented Programming
6. Using Loops
7. Generate Log Files
8. Input at Run Time
9. Help Documents
Documenting a script1m 59s
- Mark as unwatched
- Mark all as unwatched
Are you sure you want to mark all the videos in this course as unwatched?
This will not affect your course history, your reports, or your certificates of completion for this course.Cancel
Take notes with your new membership!
Type in the entry box, then click Enter to save your note.
1:30Press on any video thumbnail to jump immediately to the timecode shown.
Notes are saved with you account but can also be exported as plain text, MS Word, PDF, Google Doc, or Evernote.