|
list(range(5))
list(range(0,5))
list(range(1,11))
for x in range(5):
print(x)
s=0
for x in range(1,10+1):
s = s + x
print("x:",x," sum:", s)
my_list = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10]
results = [x**2 for x in my_list if x % 2 == 0]
print(results)
# [4, 16, 36, 64, 100] |
|