Advertisement
Guest User

Untitled

a guest
Apr 25th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.27 KB | None | 0 0
  1. def words_before_word(list,word):
  2. sum=0
  3. i=0
  4. while i<len(list) and list[i]!=word:
  5. if type(list[i])==type("aa"):
  6. sum+=1
  7. i+=1
  8. if sum==len(list):
  9. return None
  10.  
  11. return sum
  12. print(words_before_word(["tt","aaaaa","aaaaa"],"sam"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement