Created
November 2, 2016 18:16
-
-
Save aurorapar/70371f0f65e727a6ddf1c22c59543444 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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