Q: Why does 'import mysql.connector' not work but 'from mysql import connector' does? I'm starting to learn some SQL Python and upon starting I stumbled over this phenomenon. I can
from mysql import connector

but not
import mysql.connector

What is the reason for this?

I can also leave away the import statement in the first line for the second line to still work.

A: That would be because import mysql.connector implies that connector is a module, whereas from mysql import connector implies that it's an object/class/variable inside the module.
