Book Image

Python for Finance

By : Yuxing Yan
Book Image

Python for Finance

By: Yuxing Yan

Overview of this book

Table of Contents (20 chapters)
Python for Finance
Credits
About the Author
Acknowledgments
About the Reviewers
www.PacktPub.com
Preface
Index

Python language is case sensitive


Case sensitive means that x is different from X. The variable of John is different from the variable of john. If we assume a value for x (lowercase x) and then call X (uppercase X), we will see the following error message:

>>>x=2
>>>X
Traceback (most recent call last):
       File "<pyshell#1>", line 1, in <module>
           X
       NameError: name 'X' is not defined
>>>

In the preceding example, X is not assigned any value. Thus, when we call it by typing X, we will receive an error message. Note that the last line mentions NameError instead of TypeError. In Python, we use name for variables.