Python Programming for Hackers (Part 2) - All About Variables and Arithmetic Expressions
- There are two major Python versions, Python 2 and Python 3. Python 2 and 3 are quite different. This tutorial uses Python 2, because it's more widely used and supported. However, Python 3 is more semantically correct, and supports newer features. As I said, this tutorial uses Python 2, but in some cases we'll work with Python 3.
- One difference between Python 2 and 3 is the "print" statement. In Python 2, the "print" statement is not a function, and therefore it's invoked without parentheses. However, in Python 3, it's a function, and must be invoked with parentheses.
- Once we store values in variable, it helps in avoiding recomputing of same values.- Assigning variables also helps reader to understand codes.- Valid variable name consist of: letters, numbers, underscore- Starts with letter or underscore- Legal names : hacker, Ethical, h_a_c_k- Illegal names: 333hacking, 1234- While assigning value to variable, we use equal to (=) sign.- Remember, double (= =) equal to sign is used to test equality.Video link: http://youtu.be/7RTDk9d15a8 I hope you enjoy the training videos. Thanks for reading and watching :)