Command to start a python console:
python
Code to print a string in Python 2:
print "Hello World"
Code to print a string in Python 3:
print("Hello World")
Code to import the datetime module:
import datetime
Code to create a function the sums two numbers:
def add(num1, num2):
return num1 + num2
Code to execute the function created above:
add(1,2)