@DiegoRodriguezT/

Diccionarios

Python

No description

fork
loading
Files
  • main.py
main.py
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
dic = {
  'clave': 1,
  'clave2': "",
  'clave3': [2,5,6,8]
}

print(dic['clave3'])

for valor in dic:
  print(dic[valor])

dic['clave'] = "Programación I"

print(dic)

del(dic['clave2'])

print(dic)

dic['clave4'] = {
  'clave4_1': "Python",
  'clave4_2': "Javascript"
}

print(dic)





lista1 = [10, 12, 13, 15, 19]
lista2 = [10, 12, 13, 15, 19]
listas = "iguales"
if len(lista1) == len(lista2):
  for i in (lista1):
    for x in (lista2):
      if i != x:
        listas = "distintas"
else:
  listas =  "distintas"
print (str("Las listas son ") + listas)