My program works with integers but doesnt work with strings
I still passed the assignment HOW???
Anyways, plz help me with the mistake i am making
i understand that i am trying to handle strings with a logic of intgers but still,
in that case then it shouldnt work allt ogether.
I want to be able to count the strings too, right now it counts only zero
here is my code below.
sequence="the the the the kostkc sdjnvithe therrrw theis" item="the" def count(sequence,item): reps=0 # sequence=sequence.split() for x in range(len(sequence)): if sequence[x]==item: reps+=1 # seq=' '.join(sequence) return reps print count(sequence,item) print count("the the the the kostkc sdjnvithe therrrw theis","the")