2 + 2

2 * 3

1 / 2 

7 // 2

4 ** 3

23 % 4

var = 2 
var2 = 54

var3 = var2 - var

var3

"""
Explanation: A Crash Course in Python for Scientists
Why Python?
Python is the programming language of choice for many scientists to a large degree because it offers a great deal of power to analyze and model scientific data with relatively little overhead in terms of learning, installation or development time. It is a language you can pick up in a weekend, and use for the rest of one's life.
Please note, is not meant to be a comprehensive overview of Python or programming in general, if you have no programming experience,I suggest to read Python for You and Me.
Topic

Data types
Numbers
Strings
Printing
Lists
Dictionaries
Booleans
Tuples 
Sets


Comparison Operators
if,elif, else Statements
for Loops
while Loops
range()
list comprehension
map and filter
functions
lambda expressions
map and filter


Data types
Numbers and Arithmetics
End of explanation
"""


'Hello world' 

"Hello world"

"""
Explanation: String
End of explanation
"""


print('Hello world')

name = 'sadegh'
course = 'Machine learning'

print('My name is {} this is a {} course'.format(name,course))

print('My name is {myname} this is a {name_course} course'.format(name_course = course, myname = name))

"""
Explanation: Print
End of explanation
"""


[1, 2, 3]

[1 , [3, 4], 'hello :)']

myList = [1 ,2 ,3, 4, 5, 6]

myList.append(12)

myList

myList[2] 

myList[1:3]  

myList [1:]

myList[0:5:2]

myList[-1]

myList[0]

myList[0] = 'wow'

myList

myList = [[[1, 2 ,3], [4, 5, 6], [7, 8, 9]], [[-1, -2, -3], [-4, -5, -6], [-7, -8 , -9]]]

myList[0][2][2]

import numpy as np
np.array(myList)

"""
Explanation: Lists
End of explanation
"""


dictinary = {'key1':'item1','key2':'item2'} 

dictinary

dictinary['key1']

"""
Explanation: Dictionaries
End of explanation
"""


t = (1, 2, 3)

t[0]

t[0] = 5

"""
Explanation: Tuples
End of explanation
"""


if 23 < 34:
    print('hello')

if 5 < 2:
    print('first')
else:
    print('second')

if 1 == 2:
    print('first')
elif 3 == 3:
    print('second')
else:
    print('third')

"""
Explanation: Comparison Operators ## Logic Operators
bigger than, les than, equal and ,,,
and, or 
if,elif, else Statements
End of explanation
"""


seq = ['hello', 'python', 'good']

for i in seq:
    print(i)

seq = [1, 2, 3, 4, 5]

for i in seq:
    print (i ** 2)

"""
Explanation: for Loops
End of explanation
"""


range(5)

list(range(5))

for i in range(2,5):
    print(i)

"""
Explanation: range()
End of explanation
"""


i = 1
while i < 5:
    print('number i is: {}'.format(i))
    i += 1

"""
Explanation: while Loops
End of explanation
"""


x = [1, 2, 3, 4]

output = list()
#output = []
for i in x :
    output.append(i + 2)
output

[i + 2 for i in x]

"""
Explanation: list comprehension
End of explanation
"""


def func(param1):
    print(param1)


func(param1='hello')

def func2(number):
    return number * 2

func2(2)

"""
Explanation: functions
End of explanation
"""


seq = [1,2,3,4,5]

map(func2,seq)


list(map(func2,seq))


"""
Explanation: map and filter
End of explanation
"""


list(map(lambda var: var*2,seq))

filter(lambda item: item%2 == 0,seq)

list(filter(lambda item: item%2 == 0,seq))

"""
Explanation: lambda expressions
End of explanation
"""


