From 9fef46462c0e8980529cee61968a3bcae6252186 Mon Sep 17 00:00:00 2001 From: Mark Pilgrim Date: Tue, 4 Aug 2009 20:06:12 -0700 Subject: [PATCH] notes on case-sensitivity --- your-first-python-program.html | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/your-first-python-program.html b/your-first-python-program.html index 049b66b..26f49d0 100755 --- a/your-first-python-program.html +++ b/your-first-python-program.html @@ -324,6 +324,30 @@ NameError: name 'x' is not defined

You will thank Python for this one day. +

Everything is Case-Sensitive

+ +

All names in Python are case-sensitive: variable names, function names, class names, module names, exception names. If you can get it, set it, call it, construct it, import it, or raise it, it’s case-sensitive. + +

+>>> an_integer = 1
+>>> an_integer
+1
+>>> AN_INTEGER
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+NameError: name 'AN_INTEGER' is not defined
+>>> An_Integer
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+NameError: name 'An_Integer' is not defined
+>>> an_inteGer
+Traceback (most recent call last):
+  File "<stdin>", line 1, in <module>
+NameError: name 'an_inteGer' is not defined
+
+ +

And so on. +

Running Scripts