How to inverse the result of this pyramid in python

join shbcf.ru