dictionary in python
d = {'key1':'value1','key2':'value2'}
print(d) # to print full dictionary
l=d.keys
print(l) # to print keys
b=d.values
print(b)#to print values in dictionary
dictionary in python
d = {'key1':'value1','key2':'value2'}
print(d) # to print full dictionary
l=d.keys
print(l) # to print keys
b=d.values
print(b)#to print values in dictionary
dictionary in python
# Dictionaries in Python
ages = {"John": 43, "Bob": 24, "Ruth": 76} # Marked by { at beginning and a } at end
# ^^^ Has sets of keys and values, like the 'John' and 43 set. These two values must be seperated by a colon
# ^^^ Sets of values seperated by commas.
dict value python
obj = {0:"hello", 1:"there"}
print(obj[0])
print(obj[1])
print("\n\n\n\n\n")
for i in range(len(obj)):
print(obj[i])
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us