# Functions to deal with complex numbers -- list representation
# -> There should be no print or input statements in this section 
# -> Each function should do one thing only
# -> Functions communicate using input parameters and their return values

def create_number(a:int,b:int)->list:
    return [a,b]

def get_real(z:list)->int:
    return z[0]

def get_img(z:list)->int:
    return z[1]

def set_real(z:list,a:int)->list:
    z[0]=a
    return z

def set_img(z:list,b:int)->list:
    z[1]=b
    return z

def stringify(z:list)->str:
    return "{}{}{}i".format(get_real(z),"+" if get_img(z)>=0 else "",get_img(z))

def get_modulus(z:list)->float:
    return (get_real(z)**2+get_img(z)**2)**(1/2)