<SYSTEM_TASK:>
Given the following text description, write Python code to implement the functionality described below step by step
<END_TASK>
<USER_TASK:>
Description:
 <div style="text-align
Step1:  Two major version branches
Python 2.x
Latest
Step2:  Mis-Conceptions
python does not have types?
No! Python does have types, but they are dynamic
Step3:  Automatic Memory Management
Look for this
Step4:  General Purpose
Here are some libraries I have used 
- Web applications and API Services 
<ASSISTANT_TASK:>
Python Code:
print("Hello World")
Explanation: <div style="text-align: center;">
<h1> Python - Why should you learn? </h1>
<h3> Thamme Gowda </h3> <h4> Feb 9th, 2018. SJCIT </h4>
<br/>
<a href="https://twitter.com/thammegowda">@thammegowda</a> 
<br/>
<a href="https://isi.edu/~tg">https://isi.edu/~tg </a>
</div>
Hello World
World's simplest hello world program
End of explanation
# sample function
def add(op1, op2):
    return op1 + op2
# Integers
var1 = 10
var2 = 20
var3 = add(var1, var2)
print(var3)
# Floats
var1, var2 = 1.5, 2.6 # multiple assignment
print(add(var1, var2))
# Strings
var1 = "ABCD"
var2 = "EFGH"
var3 = add(var1, var2)
print(var3)
print(">> With great power comes great responsibility!")
Explanation: Two major version branches
Python 2.x
Latest: 2.7.x
Python 3.x 
Latest: 3.6.x
Python 3.x is not backward compatible with python 2.x.
In Python 2.x
print "Hello World" # print is a keyword
In Python 3.x
print("Hello World") # print is a built in function
I strongly recommend you to use 3.x.
When a programmer submitted HW essay
<img style="margin:auto; width:80%" src="res/if-lang-essay.jpg"/>
How python programmer learned to fly
<img style="margin:auto;" src="res/flying-python.png"/>
Huge Collection of Existing Libraries
get any library from repositories
High level ?
More english like (as high as we could get!)
Not a joke! Python code is 'executable pseudo code'
<img src="res/executable-code.jpeg" style="margin:auto"/>
Interpreted
You DONT NEED TO compile code (to the machine language)
but if you want to (for performance reasons), you CAN!
python command runs an interpreter on your python code
converted to machine instructions at run time (of course!)
So, no more compile time errors! Is it good or bad?
Bad ? Write test cases
Dynamic Typed
What is a type?
What is a cast or (type) casting? - We dont have worry in python!
End of explanation
x = "Hello"
print(type(x))
x = 10
print(type(x))
x = 1e10
print(type(x))
x = True
print(type(x))
x = None
print(type(x))
Explanation: Mis-Conceptions
python does not have types?
No! Python does have types, but they are dynamic
End of explanation
class User(object):
    def __init__(self, name, email):
        self.name = name
        self.email = email
u1 =  User(name="TG", email="tg@isi.edu")
print(u1.name, u1.email)
u1 = None # in python equivalent of NULL is None
print(u1)
# GC will free the above object when it needs memory
Explanation: Automatic Memory Management
Look for this:
- No new keyword (as in C++ or Java), no malloc calloc (as in C)
- No need to call free (as in C) or delete (as in C++)
 - Just like Java, when you lose a reference to memory, garbage collector will mark it for cleaning
End of explanation
import json
u1 =  User(name="TG", email="tg@isi.edu")
print(json.dumps(u1.__dict__))
# or, another way
®®from json import dumps
print(dumps(u1.__dict__))
# aliasing, yet another way 
from json import dumps as to_json
print(to_json(u1.__dict__))
# Another example
import numpy as np
A = np.array([
    [1, 2, 3],
    [4, 5, 6],
    [7, 8, 9]])
print(A)
AT_A = np.matmul(A.transpose(), A)
print(AT_A)
Explanation: General Purpose
Here are some libraries I have used 
- Web applications and API Services : Django, Flask,
- Windowing Applications: PyQt, TkInter, PyGTK, PyKDE, Py
- Operating system tools / Commandline : sys, os, argparse, subprocess modules
- Machine Learning / Deep learning: scikit-learn, tensorflow, keras, pytorch, libSVM, 
- Scientific Computing: scipy
- Text processing / Natural Language Processing: nltk, spacy
- Linear Algebra: numpy
- Data processing/ ETL: pandas, 
- Visualizations: Matplotlib
- Distributed and parallel computing: py-spark
- GPUs: py-cuda
- ...
Obtaining and using libraries:
use conda or pip to search and install libraries (also called modules)
Look for miniconda and install it to your system
then you can use conda install [lib_name]
example: conda install numpy
use import keyword to enable a module in your program
End of explanation
<END_TASK>