Skip to content

Commit 18cfdda

Browse files
committed
oneline update
1 parent a667c00 commit 18cfdda

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

Python/Esercizi/OneLine.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ def es0(lista):
2323
#Inserisci qui il tuo codice
2424
pass
2525

26-
# print(es0([-3, 6, 12, -5, 8, 19, -9])) # OUT: [3, 18, 7, 3, 27, 10]
26+
# print(es0([-3, 6, 12, -5, 8, 19, -9])) # OUT: [-3, 3, 18, 7, 3, 27, 10]
2727

2828

2929

Python/Soluzioni/OneLine.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@ def funct(*parametri*):
2222
"""
2323

2424
def es0(lista):
25-
return list(map(lambda i : lista[i-1] + lista[i], range(1, len(lista))))
25+
return [lista[0]] + list(map(lambda i : lista[i-1] + lista[i], range(1, len(lista))))
2626

27-
# print(es0([-3, 6, 12, -5, 8, 19, -9])) # OUT: [3, 18, 7, 3, 27, 10]
27+
# print(es0([-3, 6, 12, -5, 8, 19, -9])) # OUT: [-3, 3, 18, 7, 3, 27, 10]
2828

2929

3030

0 commit comments

Comments
 (0)