Relative Content

Tag Archive for pythonif-statement

If statement acting as if condition is false when ostensibly true

I’m having trouble with a personal project. There is a particular part of code, where sometimes it will act as if the if condition is false when it’s true and I can’t figure out why. This is for the elif at the bottom. Below are my error, prints, and code fragment. The issue only seems to appear when there is only one object in the list and even then only sometimes.

Invalid python syntax somehow?

I was trying to write some python code and it’s repeating invalid syntax for some odd reason, I can’t figure our what the big issue is?

taking a coding camp just having trouble with my elifs

im creating a rock paper scissors game and for some reason my elifs are not working. keep in mind that im not great at python and i just need an explanation and an example as to how i need to fix it so i can fix it if i run into the same problem at a later date. thanks!