Python pseudocode to code -


i having problems implementing code need write based on pseudocode have. code in python (because have limited experience it), have having problems "for" statement.

my pseudocode is:

patterncount(text, pattern)      count ← 0      ← 0 |text| − |pattern|          if text(i, |pattern|) = pattern          count ← count + 1      return count 

with input of strings text , pattern , need output of count(text, pattern)

i think should work:

 text.count(pattern) 

Comments

Popular posts from this blog

java - Custom OutputStreamAppender not run: LOGBACK: No context given for <MYAPPENDER> -

java - UML - How would you draw a try catch in a sequence diagram? -

c++ - No viable overloaded operator for references a map -