-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPractica Lista
More file actions
76 lines (60 loc) · 1.25 KB
/
Practica Lista
File metadata and controls
76 lines (60 loc) · 1.25 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
my_age=24
weight=60.2
is_legal=True
#print(my_age)
my_name = 'Gustavo'
text = 'Hola yo soy ' + my_name
text2 = '{} Yo tengo {} años'.format(text, my_age)
text3 = "Hola mama soy %s , tengo %i y estoy gordito porque peso %.1f" % (my_name, my_age, weight)
#print(my_name.upper())
#print(my_name.lower())
#print('Hola mi nombre es ' + my_name)
#print(text3)
#print(my_name[-1])
#print(len(my_name))
#if not my_age < 18 :
#print('Vamonos a beber 🍻')
beers = [
'Minerva',
'Indio',
'Victoria',
'León',
'Modelo',
'Sapporo',
'Param'
]
#print(beers)
#beers.append('Heineken')
#chela = beers.pop(0)
#chela2 = beers.remove('León')
#print(chela)
#print(chela2)
#print(beers)
#for item in beers:
#print(item)
#def multiply(a, b):
#return a * b
numbers = [1,2,3]
squared_numbers = [numero**2 for numero in numbers]
#for n in numbers:
#squared_numbers.append(n**2)
print(squared_numbers)
#upper_beers = [beer.upper() for beer in beers]
#print(upper_beers)
#m_beers = [beer for beer in beers if beer [0]=='M']
#print (m_beers)
lista = [
[1,2,3],
['a','b','c'],
[1,2,3],
['a','b','c'],
[1,2,3],
['a','b','c'],
]
lista1 =[]
for l in lista:
for e in l:
lista1.append(e)
print(lista1)
lista2 = [e for l in lista for e in l]
print(lista2)