Record#
- Today I learned about arrays and how to print data faster and more conveniently.
- Use
for value in myDictionary.values():
to get the values of the array using the values() function. - Use
for name,value in myDictionary.items():
to get the keys and values in the items function using name and value. - Today's exercise is to store data in a dictionary and then print it.
- During the process, I learned a new function
array.key()
, which returns all the keys in the array.
CODE#
print("🌟Website Rating🌟")
print()
siteinfo = {"name": None, "url": None, "desc": None, "rating": None}
for name in siteinfo.keys():
siteinfo[name] = input(f"{name}: ")
for name,value in siteinfo.items():
print(f"{name}:{value} ")