Mar-18-2020, 06:59 PM
(This post was last modified: Mar-18-2020, 07:57 PM by xxunknownxx.)
I've changed line 48 with this
I've changed line 48 with this
elif y not in options: print("Enter any of the options ")that works great so far actually. what do you think about my counter i wanted to make a counter of 5 if the computer or player gets 5 points first it prints out one of the last print statements at line 53
(Mar-18-2020, 06:43 PM)ndc85430 Wrote: On line 48, you're checking whethery
is equal to the functionstr
. Clearly, that will never beTrue
. You don't want to check whethery
is of typestr
, either (withisinstance
) because on line 10, you know it's already a string. Incidentally, you don't need the call tostr
on line 10, sinceinput
already returns a string. If you want to check whether a string contains only alphabetical characters, then have a look at the documentation to see if you can find an appropriate method.
Also, variable names likex
andy
are pretty meaningless - use names that tell you what the variable is for. That helps everyone (you included) to read and therefore understand the code.
I've changed line 48 with this
elif y not in options: print("Enter any of the options ")that works great so far actually. what do you think about my counter i wanted to make a counter of 5 if the computer or player gets 5 points first it prints out one of the last print statements at line 53