In this video, Jennifer Harrison explains many of the basic Python syntax rules. Learn how case sensitivity and spacing can impact programming in Python.
- [Jennifer] All scripting languages have rules…that must be followed in the code.…These rules are called the syntax of the language.…The first rule of Python syntax is that…Python is case-sensitive.…I'm here in the IDLE Shell window…so I can demonstrate a couple of the rules…for working with Python.…So if I type string user name equals fred,…and then I print strusername,…I get an error message…because I didn't case that variable name…exactly the way I originally defined the variable.…
So, variable names are case-sensitive,…but it's not just variable names.…Python is case-sensitive everywhere,…in the reserved words and functions…and objects and methods.…For example, if I say print sum equals,…and I try to use the string function…with an uppercase S, it simply won't work.…But this will.…
Notice, when I type the function name incorrectly,…it gets colored purple, so I know I'm doing it right.…Python has some reserved words, like print,…as well words that are used…for function names, methods, and properties.…For example, there's a string function called upper,…
- 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.