-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAula 20.py
More file actions
78 lines (70 loc) · 1.18 KB
/
Aula 20.py
File metadata and controls
78 lines (70 loc) · 1.18 KB
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
#
# def soma (a, b):
# print(f'A = {a} B = {b}')
# s = a + b
# print(f'A soma vale {s}')
# # programa principal
#
#
# a = 4
# b = 5
# s = a + b
# print(s)
# soma (4,5) #mesma coisa, só que na def
#
# a = 8
# b = 9
# s = a + b
# print(s)
# soma (8,9)
#
# a = 2
# b = 1
# s = a + b
# print(s)
# soma(2,1)
# soma(b=10, a=5)
#
# def contador(*num):
# for valor in num:
# print(f'{valor} ', end='')
# print(end=' ')
# # print('Fim')
# tam = len(num)
# print(f'Recebi os valores {num} e são {tam} números ')
#
# contador (2, 1, 7)
# contador(8, 0)
# contador(4, 4, 7, 6, 2)
#
# def dobra(lst): #lista
# pos = 0
# while pos < len(lst):
# lst[pos] *= 2
# pos +=1
#
#
# valores = [6, 3, 9, 1, 0, 2]
# dobra(valores)
# print(valores)
#
def soma(*valores): #desempacotamento
s = 0
for num in valores:
s += num
print(f'A soma dos valores {valores} é igual a {s}')
soma(5,2)
soma(2, 9, 4)
#mostralinha
# def lin ():
# print('-' * 30)
#
# lin()
# print('CURSOEMVIDEO')
# lin()
# def titulo(txt):
# print('-'*len(txt))
# print(txt)
# print('-'*len(txt))
# titulo('Danielle')
# titulo('Python é muito bom')