Set .add()

Sort by

recency

|

971 Discussions

|

  • + 0 comments
    N = int(input())
    countries = [input() for _ in range(N)]
    print(len(set(countries)))
    
  • + 0 comments

    x=int(input()) y=set() for n in range(x): y.add(input())

    print(len(y))

  • + 0 comments
    n=int(input())
    s=set()
    for i in range(n):
      a=input()
      s.add(a)
    print(len(s))
    
  • + 0 comments

    code

    a=int(input()) #total number of country stamps b=set() #input taking as set because it removes duplicate values for i in range(a): c=input() #taking country names as inputs. b.add(c) #appending country names to set print(len(b)) #obtaning length of set.**

  • + 0 comments

    Brolly Academy in Hyderabad offers a comprehensive Data Science course covering Python programming, statistics, machine learning, deep learning, NLP, and data visualization. The course includes hands-on projects, expert-led training, flexible learning modes (online, offline, self-paced), and placement assistance. Students receive lifetime access to learning materials and an industry-recognized certification upon completion. It is designed for both beginners and professionals looking to enhance their data science skills. For more details, visit Brolly Academy's website.https://brollyacademy.com/data-science-course-in-hyderabad/