Is this you? As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.
Claim your profile
Right now, as it stands, you're just converting any user input to a integer, using the function. What do you suppose happens if the user enters something like ? What you need to do is set up a - block, like this: To set up something like this in your code, you'd change your code to something like this: Rather than printing a message saying that if the user got below a certain amount of tries, they win, you can implement it into the code.
You are repeating yourself in a lot of places in your code. In fact, I'd say most all of your code is just a giant repeat. You have 4 functions in your code. These functions are almost exactly identical, except for a few tiny points. Each function is doing the same thing: getting two random numbers, logging them out with a message, and then running some conditionals on these numbers to determine what other message should be sent. Therefore, why don't you stick these all into one function?
As a journalist, you can create a free Muck Rack account to customize your profile, list your contact preferences, and upload a portfolio of your best work.