Here is the code that sort of works but the output seems to be incorrect.
I have tried everything for the code to print (e.g., before ‘return’, after ‘return’, different indentation levels, etc). While checking it, I had it print out what should have been input and I got something different out. I have reset the code and reset the page several times and I can’t seem to get it to work like the other pages (scrabble_score, anti_vowel, etc). Please help. Also, when I input this it was formatted but it seems the formatting is removed when I look at it online.
seqnc = (raw_input("Input the sequence:")) itm = (raw_input("Input the item to count: ")) def count(sequence,item): numtot = 0 for it in sequence: if(item == it): numtot += 1 return numtot print (seqnc, itm) #used this to check if input was the same as output
Input the sequence:adfadfa
Input the item to count: a
(u’adfadfa ‘, u’a’)