1 + 1

a = 1
b = 0.5
a + b

an_integer = 42 # Just an integer
a_float = 0.1 # A non-integer number, up to a fixed precision
a_boolean = True # A value that can be True or False
a_string = '''just enclose text between two 's, or two "s, or do what we did for this string''' # Text
none_of_the_above = None # The absence of any actual value or variable type

a_list = [0,1,2,3]

a_list = [ 42, 0.5, True, [0,1], None, 'Banana' ]

a_list[0]

a_tuple = ( 42, 0.5, True, [0,1], None, 'Banana' )
a_tuple[0]

a_list[5] = 'apple'

print(a_list)

a_tuple[5] = 'apple'

a_list.append( 3.14 )

print(a_list)

a_dict = { 1:'This is the value, for the key 1', 'This is the key for a value 1':1, False:':)', (0,1):256 }

a_dict['This is the key for a value 1']

a_dict['new key'] = 'new_value'

for j in range(5):
    print(j)

for j in a_list:
    print(j)

for key in a_dict:
    value = a_dict[key]
    print('key =',key)
    print('value =',value)
    print()

if 'strawberry' in a_list:
    print('We have a strawberry!')
elif a_list[5]=='apple':
    print('We have an apple!')
else:
    print('Not much fruit here!')

import numpy

numpy.sin( numpy.pi/2 )

import numpy as np

np.sin( np.pi/2 )

from numpy import *

sin( pi/2 )

def do_some_maths ( Input1, Input2 ):
    the_answer = Input1 + Input2
    return the_answer

x = do_some_maths(1,72)
print(x)

def add_sausages ( input_list ):
    if 'sausages' not in input_list:
        input_list.append('sausages')

print('List before the function')
print(a_list)

add_sausages(a_list) # function called without an output

print('\nList after the function')
print(a_list)

import random

for j in range(5):
    print('* Results from sample',j+1)
    print('\n    Random number from 0 to 1:', random.random() )
    print("\n    Random choice from our list:", random.choice( a_list ) )
    print('\n')

