Horje
python creare una list comprehension Code Example
[Solved] - python creare una list comprehension Code Example
Try following codes
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]
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]
Date: 2022-05-21 05:02:10
Category: python
More for You