def main(): lista = [] for _ in xrange(3): stringa = randomstring(random.randint(5, 15), string.ascii_letters + string.digits ) lista.append(stringa) print(lista)
def main(): lista = [] for _ in xrange(3): stringa = randomstring(random.randint(5, 15), string.ascii_letters + string.digits ) lista.append(stringa) lista2 = lista[:-1] print("this is the original list: {}".format(lista)) print("this is the copied list without the last element: {}".format(lista2))
def main(): lista = [] for _ in xrange(3): stringa = randomstring(random.randint(5, 15), string.ascii_letters + string.digits ) lista.append(stringa) lista2 = copy.copy(lista) print("this is the content of the original list: {}".format(lista)) print("this is the content of the copied list: {}".format(lista2))