Set .add()

Sort by

recency

|

1006 Discussions

|

  • + 1 comment

    Uneven cooling was making daily life uncomfortable, especially in the afternoons when heat builds up fast. During air conditioning installation central coast nsw, guidance from Tech Air solutions helped make sense of what was actually needed for the space. After setup, the airflow felt more consistent and easier to manage. It fixed an ongoing comfort issue without adding extra stress.

  • + 0 comments

    Easy way to go: * NumStamps= int(input()) * print(len({input() for _ in range(NumStamps)}))

  • + 0 comments
    1. N=int(input())
    2. l=set()
    3. for i in range(N):
    4. country=input()
    5. l.add(country)
    6. print(len(l))
  • + 0 comments

    Count = int(input())

    distinct = set()

    for i in range(Count):

    country = input()
    
    distinct.add(country)
    

    print(len(distinct))

  • + 0 comments
    N = int(input())
    
    counter = 0
    distinct_country_stamps = set()
    
    for i in range(N):
        country = input()
        
        if country not in distinct_country_stamps:
            distinct_country_stamps.add(country)
            counter += 1
        
    print(counter)