1
0

More than 3 years have passed since last update.

python お一人様一点限り機能

Last updated at Posted at 2021-09-07

お一人様一点限りを判定する

重複があるか無いかで判断する。

n = int(input())

person_list = []
for i in range(n):
    person_list.append(input())

    if(person_list.count(person_list[i]) == 1):
        print("YES")
    else:
        print("NO")

入力例2
4
Jimmy
Bob
James
Jimmy

出力例2
YES
YES
YES
NO

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0