(user)
return ', '.join([device.device_id for device in sorted(
        user.devices, key=lambda d: d.last_used, reverse=True
    )])
Returns a comma-separated list of IMEI numbers of the user's devices, sorted with most-recently-used first
Returns a comma-separated list of IMEI numbers of the user's devices, sorted with most-recently-used first
Returns a comma - separated list of IMEI numbers of the user s devices sorted with most - recently - used first
def get_devices(user):
    """
    Returns a comma-separated list of IMEI numbers of the user's devices, sorted with most-recently-used first
    """
    return ', '.join([device.device_id for device in sorted(
        user.devices, key=lambda d: d.last_used, reverse=True
    )])
def get_devices ( user ) : return ', ' . join ( [ device . device_id for device in sorted ( user . devices , key = lambda d : d . last_used , reverse = True ) ] )