data_str = pprint.pformat(student_db)
AttributeError: частично инициализированный модуль «pprint» не имеет атрибута «pformat» ( скорее всего из-за циклического импорта)
Код: Выделить всё
import pprint
student_db = {"Dwayne Johnson": ["English", "Chemistry", "Physics", "Mathematics", "Biology"],
"Randy Orton" :{"English": 50,"Physics": 60,
"Chemistry": 70, "Mathematics": 80, "Biology": 90},
"Karl Marx" :(50, 60, 70, 80, 90)}
data_str = pprint.pformat(student_db)
with open(r'sample2.txt','w') as file:
file.write(data_str)
Что мне делать?
Подробнее здесь: https://stackoverflow.com/questions/785 ... as-no-attr