Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion sonar-scanner/src/python/fortune.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,6 @@ def get(filename):
if __name__ == '__main__':
import sys
if len(sys.argv) == 1:
print 'Usage: fortune.py <filename>'
print('Usage: fortune.py <filename>')
sys.exit()
print get(sys.argv[1])
10 changes: 5 additions & 5 deletions sonar-scanner/src/python/letters.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,14 +147,14 @@ def play_once():
else: asked.append(field) # Note that this question was asked.
print str(result)+'.'
if (original_length==new_length):
print 'That was a wasted question; it did not exclude any possibilities.'
print('That was a wasted question; it did not exclude any possibilities.')
elif (new_length<original_length/2 or new_length==1):
print "Good question."
print("Good question.")
else:
print "I don't understand the question."
print("I don't understand the question.")

# Print the instructions
print """This is a guessing game about capital letters.
print("""This is a guessing game about capital letters.
You can ask various questions about the features of the letter:
curves, loose ends, obliques (or diagonals), horizontals, verticals.
To make a guess, just enter the letter of your choice.
Expand All @@ -171,7 +171,7 @@ def play_once():
Next? s
You don't have enough information yet.
How do you know it isn't c, for example?
"""
""")

# Play a single game
play_once()
Expand Down