Record#
- Today I learned about arrays, 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 keys and values in the items() function. - Today's practice involves storing data in a dictionary and then printing it.
- Learned a new function during the process
array.key()
, which returns all 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} ")