Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def words_before_word(list,word):
- sum=0
- i=0
- while i<len(list) and list[i]!=word:
- if type(list[i])==type("aa"):
- sum+=1
- i+=1
- if sum==len(list):
- return None
- return sum
- print(words_before_word(["tt","aaaaa","aaaaa"],"sam"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement