Python If Else Problem Hackerrank