#๐Ÿ”’ Why is this syntax error happening please?

17 messages ยท Page 1 of 1 (latest)

rustic basalt
#

everything seems fine. Any help ?

autumn totemBOT
#

@rustic basalt

Python help channel opened

Remember to:

  • Ask your Python question, not if you can ask or if there's an expert who can help.
  • Show a code sample as text (rather than a screenshot) and the error message, if you've got one.
  • Explain what you expect to happen and what actually happens.

:warning: Do not pip install anything that isn't related to your question, especially if asked to over DMs.

hot meadow
nocturne storm
#

your + is in the wrong spot

rustic basalt
#

input('Bravo! The answer is indeed '+number+', you found it in '+guessesTaken+1'guesses.')

hot meadow
#

So if I switch that into a print statement

nocturne storm
#

or rather, that 1 shouldn't be there

hot meadow
#

And run it against a Python interpreter

#

!e

print('Bravo! The answer is indeed '+number+', you found it in '+guessesTaken+1'guesses.')
autumn totemBOT
# hot meadow !e ```py print('Bravo! The answer is indeed '+number+', you found it in '+guesse...

:x: Your 3.13 eval job has completed with return code 1.

001 |   File "/home/main.py", line 1
002 |     print('Bravo! The answer is indeed '+number+', you found it in '+guessesTaken+1'guesses.')
003 |           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
004 | SyntaxError: invalid syntax. Perhaps you forgot a comma?
rustic basalt
#

you're right, I erased the +1 but still same error

hot meadow
rustic basalt
#

That was it thanks

#

!close

autumn totemBOT
#
Python help channel closed with !close

This help channel has been closed. Feel free to create a new post in #1035199133436354600. To maximize your chances of getting a response, check out this guide on asking good questions.