“Python Get Dictionary Keys como lista” Código de respuesta

Python Get Dictionary Keys como lista

# To get all the keys of a dictionary as a list, see below
newdict = {1:0, 2:0, 3:0}
list(newdict)
# Output:
# [1, 2, 3]
SkelliBoi

Convertir las claves del diccionario para enumerar Python

newlist = list()
for i in newdict.keys():
    newlist.append(i)
Thoughtless Tiger

Respuestas similares a “Python Get Dictionary Keys como lista”

Preguntas similares a “Python Get Dictionary Keys como lista”

Más respuestas relacionadas con “Python Get Dictionary Keys como lista” en Python

Explore las respuestas de código populares por idioma

Explorar otros lenguajes de código