0

I had a "cyclomatic complexity too high" error so I wanted to reduce the size of the statements. I wanted to change this:

if amount_triangles == 1: 
 player = 3
if amount_triangles == 3:
 player = 3
if amount_triangles == 5:
 player = 3 

to this:

if amount_triangles == 1 or 3 or 5: 
 player = 3

For me it seems like the same but the outcome is very different. Can someone explain me the difference between these two codes?

Sorry if the question is too simple but I didn't found anything in the Internet that answered my question (and for my english).

Cowcake
  • 13
  • 6

0 Answers0