我有一个字典中像Python:Python元组列表的字典。从元组元件的打印列表
{1: [('type', 'USB'), ('ipaddress', '192.168.1.1'), ('hostname', 'hello'), ('realname', 'world')], 2: [('type', 'Stereo'), ('ipaddress', '192.168.1.2'), ('hostname', 'hi'), ('realname', 'mum')]}
我将如何打印键顺序(1,2等)的列表的表示,主机名,以便输出将是:
hello
hi
感谢
你说的按键的顺序是什么意思? Python中的字典没有订购 – wnnmaw