# "Invalid Syntax" error despite completely valid syntax

**URL:** <https://discuss.python.org/t/invalid-syntax-error-despite-completely-valid-syntax/53318>\
**Category:** Python Help\
**Created:** [May 14, 2024, 5:10pm UTC](https://discuss.python.org/t/invalid-syntax-error-despite-completely-valid-syntax/53318 "2024-05-14T17:10:18Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![tjreedy](https://sea2.discourse-cdn.com/flex002/user_avatar/discuss.python.org/tjreedy/32/137_2.png) [@tjreedy](https://discuss.python.org/u/tjreedy)\
**Post date:** [May 15, 2024, 3:12am UTC](https://discuss.python.org/t/invalid-syntax-error-despite-completely-valid-syntax/53318/7 "2024-05-15T03:12:31Z")

</div>

Christian, and other beginners. The python parser is **extensively** tested. One can be something like 99.9999% sure that reported syntax errors are valid. Also, please reduce examples to the minimum needed to get the claimed misbehavior. Doing so will often reveal the answer.

Also use modern python to get better error messages. In 3.10+:

```python
>>> withdrawal = float(input("How much would you like to withdraw?: $")
... bal -= withdrawal
  File "<stdin>", line 1
    withdrawal = float(input("How much would you like to withdraw?: $")
                       ^
SyntaxError: invalid syntax. Perhaps you forgot a comma?

```

---

_[View the full topic](https://discuss.python.org/t/invalid-syntax-error-despite-completely-valid-syntax/53318)._
