users = {'sam': 20, 'mike': 30, 'joe': 40} # return users where the ave is greater than 20 users_over_20 = {k: v for k, v in users.items() if v > 20} # print users over 20 print(users_over_20) # output {'mike': 30, 'joe': 40}