具有长键和值名称的Python字典

时间:2015-11-12 22:05:31

标签: python dictionary

我有一个字典,其条目超过80个字符,我想知道在新行中获取密钥值是否有任何问题?即:

from datetime import date

name = 'NAME'
mdy = date.today().strftime('%m%d%y')
d_my = date.today().strftime('%m-%y')

files = {
    '{}_FirstFile_{}.TXT'.format(name, mdy):
        '{}-FirstReport_{}.xlsx'.format(name, d_my),

    '{}_SecondFile_{}.TXT'.format(name, mdy):
        '{}-SecondReport_{}.xlsx'.format(name, d_my),

    '{}_ThirdFile_{}.TXT'.format(name, mdy):
        '{}-ThirdReport_{}.xlsx'.format(name, d_my),

    '{}_FourthFile_{}.TXT'.format(name, mdy):
        '{}-FourthReport_{}.xlsx'.format(name, d_my)
    }

0 个答案:

没有答案