Code the variable offline, use .difference() to get the friends elements that are not in online, and save the set in the variable.
offline
.difference()
friends
online
Make sure to type offline = friends.difference(online).
offline = friends.difference(online)