二手产品经理

二手产品经理

THIS IS RENO

Loop printing array - 41 days - Learn Python online in 100 days

Record#

  1. Today I learned about arrays and how to print data faster and more conveniently.
  2. Use for value in myDictionary.values(): to get the values of the array using the values() function.
  3. Use for name,value in myDictionary.items(): to get the keys and values in the items function using name and value.
  4. Today's exercise is to store data in a dictionary and then print it.
  5. 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} ")
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.