var = 321 # Create an integer assignment.
print type(var)
var = 'HKU' # The new `var` variable is now become a string type.
print type(var)

"""
Explanation: Python Intrinsic Data Type
Overview
Python has these common built-in Data Types:
https://docs.python.org/2/library/stdtypes.html

Numeric
String
Boolean
List
Tuple
Dictionary
Set

Python will set the variable type once it is assigned. You can change the variable type if the new variable value is set to another type. For example:
End of explanation
"""


a = 68
print a,"is a",type(a)

b = 32385848583853453453255459395439L
print b,"is a",type(b)

c = 45.67
print c,"is a",type(c)

d = 3.14j
print d,"is a",type(d)

"""
Explanation: Numeric
Numeric Types are basic data storage in nearly every programming languages. In python, they can be : int, long, float and complex.
| Type | Format | Description |
|:----:|:------:|:--------|
| int | a = 10| Signed Integer |
| long | a = 345L | (L) Long integers |
| float | a = 45.67 | (.) Floating point real values |
| complex | a = 3.14j | (j) Complex number, Python use j to denote the imaginary part. |
Python numbers variables are created by the standard assign method:
End of explanation
"""


a = 10
b = 15
print a + b , a - b , a * b , a / b

"""
Explanation: Arithematic
Basic arithmatic functions 
You can print different variables at the same time with comma-separated, and the different arthimatic operations are showned
End of explanation
"""


Name = 'Stephen Ng'
Subject = "Lunar eclipse open house today"
Email = "ncy@astro.physics.hku.hk"
Content='''There will be a lunar eclipse observable in Hong Kong on Jan 31 starting at 19:48pm. The Department will arrange an open house for the observatory at the roof from 7pm.
'''

print "from:", Name, '<'+Email+'>'
print "subject:", Subject
print "-------------------------------------------"
print Content

print Content[0] # this will print the first character
print Content[1:5] # this will print the substring

"""
Explanation: String
String types are created by enclosing characters in quotes. Single quotes ' double quotes " can be used to denote a string in one-line. The triple quotes """ can define a multi-line string. They shall be in pairs.
End of explanation
"""


b1 = True
b2 = False
b3 = (b1 and b2) or (b1 or b2)
print b1,b2,b3

not True

"""
Explanation: Boolean
Boolean
End of explanation
"""


# Octal integers
a = 01
b = 027
c = 06645
print a,"is a",type(a)

# Hexadecimal integers
a = 0x1
b = 0x17
c = 0xDA5 
print b,"is a",type(b)

"""
Explanation: More on Integer
Because Python has arbitrarily large integers, there will not be integer overflow happened. An an integer overflow occurs when an arithmetic operation attempts to create a numeric value that is outside of the range that can be represented with a given number of bits – either larger than the maximum or lower than the minimum representable value. Integer can also be defined using octal or hexadecimial notation, theyare the same thing from the computer point-of-view
End of explanation
"""


