oskb
>>> cleese={}
>>> palin=dict()
>>> type(cleese)
<class \'dict\'>
>>> type(palin)
<class \'dict\'>
>>> cleese[\'Name\']=\'John Cleese\'
>>> cleese[\'Occupations\']=[\'actor\',\'comedian\',\'writer\',\'film producer\']
>>> palin={\'name\':\'Michael Palin\',\'Occupations\':[\'comedian\',\'actor\',\'writer\',\'tv\']}
>>> palin[\'name\']
\'Michael Palin\'
>>> cleese[\'Occupations\'][-1]
\'film producer\'
>>> palin[\'Brithplace\']="England"
>>> cleese[\'Birthplace\']="US"
>>> palin
{\'Occupations\': [\'comedian\', \'actor\', \'writer\', \'tv\'], \'name\': \'Michael Palin\', \'Brithplace\': \'England\'}
>>> cleese
{\'Name\': \'John Cleese\', \'Occupations\': [\'actor\', \'comedian\', \'writer\', \'film producer\'], \'Birthplace\': \'US\'}
>>> 

 

分类:

技术点:

相关文章: