1
list_out = [  
    {'name':'agus', 'prodi':'if'},  
    {'name':'budi', 'prodi':'ti'}, 
    {'name':'candra', 'prodi':'si'}, 
]

how can i acces the prodi and print the prodi

def sortku(list_):  
    if len(list_)<=1: 
        return list_  
    if len(list_)==2: 
        return list_ if list_[0]<list_[1] else [list_[1],list_[0]]  
    print(list_out) 

    x=list_["prodi"]  
    print(x)  

this is what i try but its error

0 Answers0