Advertisement
Guest User

Untitled

a guest
Feb 25th, 2018
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. def findLetters(myList, myString):
  2.  
  3. StrList = []
  4. allGood = False
  5.  
  6. for q in myString:
  7. StrList.append(q)
  8.  
  9. for element in myList:
  10. for c in element:
  11. i = 0
  12. length = len(StrList)
  13.  
  14. while i < length:
  15. if StrList[i] == c:
  16. StrList.pop(i)
  17. length = length - 1
  18. else:
  19. i = i + 1
  20.  
  21.  
  22. if len(StrList) == 0:
  23. return True
  24. else:
  25. return False
  26.  
  27.  
  28. print(findLetters(["hello", "world"], "hold"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement