One difference is that import matplotlib is valid Python and %matplotlib inline is not :) Did you mean to tag this with jupyter and/or jupyter-notebook as well?
In modern Jupyter, you often no longer need %matplotlib inline. See here for understanding how even if not necessary you may wish to use it if you are regularly employing advanced Matplotlib settings. As for importing the matplotlib module, core Python is kept sparse for more flexibility/cleaner namespace & so in Python you need to import additional modules and packages that are more domain specific.
import matplotlibis valid Python and%matplotlib inlineis not :) Did you mean to tag this withjupyterand/orjupyter-notebookas well?%matplotlib inline. See here for understanding how even if not necessary you may wish to use it if you are regularly employing advanced Matplotlib settings. As for importing the matplotlib module, core Python is kept sparse for more flexibility/cleaner namespace & so in Python you need to import additional modules and packages that are more domain specific.