“Wörterbuch in Python” Code-Antworten

Python Dictionary

human = {
  "code": "Python",
  "name": "John",
  "age": 32
}

print(human["age"])
#32 :D
The Cat Coder

Wörterbuch in Python

Polygon = {
	"PolygonName" : "Tetrahectaseptadecagon"
	"PolygonSides" : 417
}

print("A", (Polygon["PolygonName"]) "has", (Polygon["PolygonSides"]), "sides")
Rick Astley

Wörterbuch in Python

myDict = {
    "Fast": "In a Quick Manner",
    "Hasya": "A Coder",
    "Marks": [1, 2, 5],
    "anotherdict": {'hasya': 'Player'}
}

# print(myDict['Fast'])
# print(myDict['Hasya'])
myDict['Marks'] = [45, 78]
print(myDict['Marks'])
print(myDict['anotherdict']['hasya'])
Coding boy Hasya

Wörterbuch in Python

#a dictionary
dict = {
  "key": "value",
  "other_key": "value"
}

#get a value from the dictionary using the key
print(dict["key"])

#you can also get a value from the dictionary using a normal index:
print(dict[1])
Poor Pony

Wörterbuch in Python

dict1={1:"Tutorials",2:"Point",3:1116}
print("Dictionary 1",dict1)
dict2={1:"TutorialsPoint","TP":"DictionaryTutorial"}
print("Dictionary 2",dict2)
MARIANA ESQUIVEL

Wörterbuch in Python

Dict = {"name": 'Izhaan', "salary": 1234, "age": 23} 
print("\nDictionary with the use of string Keys: ") 
print(Dict)
Bored Buzzard

Ähnliche Antworten wie “Wörterbuch in Python”

Fragen ähnlich wie “Wörterbuch in Python”

Durchsuchen Sie beliebte Code-Antworten nach Sprache

Durchsuchen Sie andere Codesprachen