Set .add()

Sort by

recency

|

949 Discussions

|

  • + 0 comments
    n_country = int(input())
    country_list = set()
    total_input = 0
    while total_input < n_country:
        x = str(input())
        country_list.add(x)
        total_input += 1
    
    print(len(country_list))
    
  • + 0 comments

    user_input = int(input())

    countries_stamps = set()

    for i in range(user_input): country = input().strip() countries_stamps.add(country)

    print(len(countries_stamps))

  • + 0 comments

    a=int(input()) s=set(input() for i in range (a)) print(len(s))

  • + 0 comments
    n = int(input())
    stamps = [input() for i in range(n)]
    
    distinct_country = set()
    for i in stamps:
        distinct_country.add(i)
    
    print(len(distinct_country))
    
  • + 0 comments

    country = set() for i in range(int(input())): country.add(input()) print(len(country))