Python enthält Übungen 100
Thema: Liste in das Wörterbuch.
Programmanalyse: Keine.
Source Code:
#!/usr/bin/python # -*- coding: UTF-8 -*- i = ['a', 'b'] l = [1, 2] print dict([i,l])
Das obige Beispiel Ausgabe lautet:
{'a': 'b', 1: 2}
Thema: Liste in das Wörterbuch.
Programmanalyse: Keine.
Source Code:
#!/usr/bin/python # -*- coding: UTF-8 -*- i = ['a', 'b'] l = [1, 2] print dict([i,l])
Das obige Beispiel Ausgabe lautet:
{'a': 'b', 1: 2}