this code is easy to read and understand so you can get some idea about random method in python...
GimhanSL/Password-genarator-in-python-random
This code will generate password to your password length.....#
This code will generate password to your password length.....#