get all the letters in Python

How do I get all the letters in Python?


if we want to know how many letters are used in the string then we can take help of set ( ) function which will remove repetition of letters. let’s see example of it-
  1. x="this is our first line" 
  2. s=set(()) 
  3. for i in range(len(x)): 
  4. if x[i]==" ": 
  5. pass 
  6. else: 
  7. s.add('%s'%x[i])
  8. print(s)

Comments

Popular posts from this blog

Programmingshark index 6

Proassignmenthelp index 12

Proassignmenthelp index 27