# Functions to deal with complex numbers -- dict 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 {"real":a, "img":b}

def get_real(z:dict)->int:
    return z["real"]

def get_img(z:dict)->int:
    return z["img"]

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

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

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

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