---
# System prepended metadata

title: Untitled

---

```
# loginIdsに入っているIDのリストのうち、
# paidIdsに含まれ、かつ、blockIdsに含まれていないIDのリストを返すメソッド「premiumUserIds」を完成させよ
# 引数の例 : 
# loginIds = [1, 2, 3, 4, 5, …, 1000]
# paidIds = [10,45,89 …, 13001, 13112]
# blockIds = [3, 1843, …, 2221]
def premiumUserIds(loginIds, paidIds, blockIds):
```

def premiumUserIds(loginIds, paidIds, blockIds):
    premiumUserIds = []
    for pairId in pairIds:
        if pairId in loginIds:
            premiumUserIds.append(pairId)
    for blockId in blockIds:
        if blockId in premiumUserIds:
            premiumUserIds.delete(blockId)
    return premiumUserIds
    
def premiumUserIds(loginIds, paidIds, blockIds):
    premiumUserIds = set(pairIds) - set(blockIds)
    return premiumUserIds と loginIds の積集合をとる
        