Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ######################################################################################################################################
- # #
- #
- # Man aha hari aka array nagize nkoresheje aka algo ka c++ mukwandika muri file ama variable muri array # ya python gusa ntibikunda ko ndagashirako ako ka array kuko gapima konyene 6MB
- #
- # #
- ######################################################################################################################################
- def iskirundi(word):
- if word.lower().startswith('ku') or word.lower().startswith('gu') or word.lower().startswith('kw'):
- return True
- elif word.lower() in kir:
- return True
- else:
- return False
- def percentage_of_kirundi(txt):
- count=0
- possible_words=txt.lower().split(' ')
- for word in possible_words:
- if iskirundi(word):
- count+=1
- else:
- kir.append(word)
- return "tugerageje kuraba tugakoresha ubumenyi iyi machini ifise iryo jambo ni ikirudi ku bice "+str((count*100)/len(possible_words))+" kw'ijana"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement