number = 5 # integer
real = -3.4 # float

name = 'Asja' # string
surname = "Sarkana" # string

boolean1 = True # Boolean 
boolean1 = False # Boolean 

a = 13
b = 5
print("a =",a)
print("b =",b)
print()

# basics operators
print("a + b =",a+b)
print("a - b =",a-b)
print("a * b =",a*b)
print("a / b =",a/b)

a = 13
b = 5
print("a =",a)
print("b =",b)
print()

# integer division
print("a//b =",a//b)

# modulus operator
print("a mod b =",a % b)

b = 5
print("b =",b)
print()

print("b*b =",b**2)
print("b*b*b =",b**3)
print("sqrt(b)=",b**0.5)

# list
mylist = [10,8,6,4,2] 

print(mylist)

# tuple
mytuple=(1,4,5,'Asja') 

print(mytuple)

# dictionary
mydictionary = {
    'name' : "Asja",
    'surname':'Sarkane',
    'age': 23
}

print(mydictionary)

print(mydictionary['surname'])

# list of the other objects or variables
list_of_other_objects =[
    mylist,
    mytuple,
    3,
    "Asja",
    mydictionary
]

print(list_of_other_objects)

# length of a string
print(len("Asja Sarkane"))

# size of a list
print(len([1,2,3,4]))

# size of a dictionary
mydictionary = { 'name' : "Asja", 'surname':'Sarkane', 'age': 23}
print(len(mydictionary))

i = 10
while i>0: # while condition(s):
    print(i)
    i = i - 1   

for i in range(10): # i is in [0,1,...,9]
    print(i)

for i in range(-5,6): # i is in [-5,-4,...,0,...,4,5]
    print(i)

for i in range(0,23,4): # i is in [0,4,8,12,16,20]
    print(i)

for i in [3,8,-5,11]: 
    print(i)

for i in "Sarkane":
    print(i)

# dictionary
mydictionary = {
    'name' : "Asja",
    'surname':'Sarkane',
    'age': 23,
}

for key in mydictionary:
    print("key is",key,"and its value is",mydictionary[key])

for a in range(4,7):
    
    # if condition(s)
    if a<5: 
        print(a,"is less than 5")
        
    # elif conditions(s)
    elif a==5: 
        print(a,"is equal to 5")
        
    # else
    else:
        print(a,"is greater than 5")

# Logical operator "and"
i = -3
j = 4
if i<0 and j > 0:  
    print(i,"is negative AND",j,"is positive")

# Logical operator "or"
i = -2
j = 2
if i==2 or j == 2:  
    print("i OR j is 2: (",i,",",j,")")

# Logical operator "not"
i = 3
if not (i==2):
    print(i,"is NOT equal to 2")

# Operator "equal to"
i = -1
if i == -1:
    print(i,"is EQUAL TO -1")

# Operator "not equal to"
i = 4
if i != 3:
    print(i,"is NOT EQUAL TO 3")

# Operator "not equal to"
i = 2
if i <= 5:
    print(i,"is LESS THAN OR EQUAL TO 5")

# Operator "not equal to"
i = 5
if i >= 1:
    print(i,"is GREATER THAN OR EQUAL TO 3")

A =[
    [1,2,3],
    [-2,-4,-6],
    [3,6,9]
]

# print all
print(A)
print()

# print list by list
for list in A:
    print(list)

list1 = [1,2,3]
list2 = [4,5,6]

#concatenation of two lists

list3 = list1 + list2
print(list3)

list4 = list2 + list1
print(list4)

list = [0,1,2]

list.append(3)
print(list)

list = list + [4]
print(list)

def summation_of_integers(n):
    summation = 0
    for integer in range(n+1):
        summation = summation + integer
    return summation

print(summation_of_integers(10))
print(summation_of_integers(20))

from random import randrange

print(randrange(10),"is picked randomly between 0 and 9")
      
print(randrange(-9,10),"is picked randomly between -9 and 9")

print(randrange(0,20,3),"is picked randomly from the list [0,3,6,9,12,15,18]")