Refactor Python Bob solution - elifs are redundant