Latest web development tutorials

Python Übung Beispiel 7

Python 100 Li Python 100 Li

Thema: Das Kopieren von Daten von einer Liste in eine andere Liste.

Programmanalyse: die Liste mit [:].

Source Code:

#!/usr/bin/python
# -*- coding: UTF-8 -*-

a = [1, 2, 3]
b = a[:]
print b

Das obige Beispiel Ausgabe lautet:

[1, 2, 3]

Python 100 Li Python 100 Li