Guest User

Untitled

a guest
Feb 22nd, 2018
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.71 KB | None | 0 0
  1. #Alphabet class
  2. class Alphabet(object):
  3.  
  4. def __init__(self, s):
  5. self.s = s
  6.  
  7. def __str__(self):
  8. return "Before: " + str(self.s)
  9.  
  10.  
  11. #Define your Vowels class here
  12. class Vowels:
  13. def __init__(self,vowelList):
  14. self.vowelList = vowelList
  15.  
  16. def __str__(self):
  17. return "Invoking the method in Vowels by passing the Alphabet objectnAfter: " + str(vowelList)
  18.  
  19. def addVowels(self,a_obj):
  20. for letter in a_obj:
  21. if letter in 'aeiou':
  22. vowelList.append(letter)
  23. l = ','.join(vowelList)
  24.  
  25. a1 = Alphabet('A,B,C,E,I')
  26. print a1
  27. b = Vowels(a1)
  28. b.addVowels(a1)
  29. print (a2)
Add Comment
Please, Sign In to add comment