![type error in thonny type error in thonny](https://heardlibrary.github.io/digital-scholarship/script/python/images/thonny-9a.png)
Some examples are assigning to literals and function calls. There are several cases in Python where you’re not able to make assignments to objects. In the sections below, you’ll see some of the more common reasons that a Synta圎rror might be raised and how you can fix them. When you encounter a Synta圎rror for the first time, it’s helpful to know why there was a problem and what you might do to fix the invalid syntax in your Python code. You’ll take a closer look at these exceptions in a later section. A TabError is raised when your code uses both tabs and spaces in the same file. An IndentationError is raised when the indentation levels of your code don’t match up. These exceptions both inherit from the Synta圎rror class, but they’re special cases where indentation is concerned. These are equivalent to Synta圎rror but have different names: There are two other exceptions that you might see Python raise. The Synta圎rror traceback might not point to the real problem, but it will point to the first place where the interpreter couldn’t make sense of the syntax. In the example above, the file name given was theofficefacts.py, the line number was 5, and the caret pointed to the closing quote of the dictionary key michael.
Type error in thonny how to#
To learn more about the Python traceback and how to read them, check out Understanding the Python Traceback and Getting the Most out of a Python Traceback.
![type error in thonny type error in thonny](https://secureservercdn.net/192.169.220.245/x75.423.myftpupload.com/wp-content/uploads/2021/10/Thonny-script-editor-768x401.png)
![type error in thonny type error in thonny](https://cdn.sparkfun.com/assets/learn_tutorials/9/0/7/Pi-Qwiic-Python-Run-Demo-Command-Line.jpg)
Note: This tutorial assumes that you know the basics of Python’s tracebacks.