discrete structures with python