-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathpython_exercise_page60.py
More file actions
51 lines (34 loc) · 884 Bytes
/
Copy pathpython_exercise_page60.py
File metadata and controls
51 lines (34 loc) · 884 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#esercizio numero 4.3 pagina 60
for value in range(1, 21):
print(value)
#esercizio numero 4.4
for value in range(1, 101):
print(value)
#esercizio numero 4.5
numbers = list(range(1, 101, 1))
print(numbers)
print(min(numbers))
print(max(numbers))
print(sum(numbers))
#esercizio numero 4.6
numbers = []
for value in range(1,21):
number = value * 1
numbers.append(number)
print(numbers)
#esercizio numero 4.7
multiple_of_3 = list(range(3,31,3))
print(multiple_of_3)
multitples_of_three = []
for value in range(3, 31, 3):
multiple_of_3 = value
multitples_of_three.append(value)
print(multitples_of_three)
#esercizio numero 4.8
cubes = []
for value in range (1, 11):
cubes.append(value ** 3)
print(cubes)
#esercizio numero 4.9
cubes = [value ** 3 for value in range(1, 11)]
print(cubes)