Python-Übungsbeispiel 32
Titel:Geben Sie die Werte der Liste in umgekehrter Reihenfolge aus.
Programmanalyse:Keine.
Programmquellcode:
Beispiel
#!/usr/bin/python
# -*- coding: UTF-8 -*-
a = ['one', 'two', 'three']
for i in a[::-1]:
print (i)
Die Ausgabe des obigen Beispiels ist:
three two oneWeitere Erweiterungen
Python 100 Beispiele