Esercizio 3 Prova Pratica 30-05-2012

From Sistemi Operativi
Revision as of 17:30, 10 May 2015 by Pierg (talk | contribs) (Created page with "==Soluzione di Pierg== <source lang ="python"> import sys, os lines = [] directory = sys.argv[1] for file in os.listdir(directory): lines.append(file) for el in lin...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to navigation Jump to search

Soluzione di Pierg

import sys, os

lines = []
directory = sys.argv[1]

for file in os.listdir(directory):
    lines.append(file)
    
for el in lines:
    for le in lines:
        if el[::-1] == le:
            print el