Python: Simple graph representation. Test fails

join shbcf.ru