Skip to content

Commit 3aa2712

Browse files
committed
Simplify string formatting code
1 parent a26828e commit 3aa2712

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

part2/experiments.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,8 @@ def main():
4040
else:
4141
num_wrongly_classified += 1
4242

43-
print("Accuracy of SVM classifier was " + str("{0:.3%}").format(numpy.mean(results == test_labels)))
43+
accuracy = str("{0:.3%}").format(numpy.mean(results == test_labels))
44+
print("Accuracy of SVM classifier was " + accuracy)
4445

4546

4647
def parse_command_line_arguments():

0 commit comments

Comments
 (0)