committing my homework after lesson 03

@slead the attempts += 1 can be moved outside of the if elsif blocks