Skip to content

Instantly share code, notes, and snippets.

@aurorapar
Created November 2, 2016 18:16
Show Gist options
  • Save aurorapar/70371f0f65e727a6ddf1c22c59543444 to your computer and use it in GitHub Desktop.
Save aurorapar/70371f0f65e727a6ddf1c22c59543444 to your computer and use it in GitHub Desktop.
def checkPred(myString):
predicates = 0
for line in myString:
myLine = line
while "//" in myLine:
myLine = line.split("//")[0] # Gets the part of the string BEFORE "//"
words = []
for word in myLine:
words.append(word)
for x in words:
if x == 'if':
predicates += 1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment