Answers for "python creare una list comprehension"

0

python creare una list comprehension

quadrati = []

for n in range(10):
    quadrati.append(n**2)

print(quadrati)
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Posted by: Guest on March-10-2020
0

python creare una list comprehension

quadrati = [n**2 for n in range(10)]

print(quadrati)
[0, 1, 4, 9, 16, 25, 36, 49, 64, 81]
Posted by: Guest on March-10-2020

Code answers related to "python creare una list comprehension"

Python Answers by Framework

Browse Popular Code Answers by Language