二手产品经理

二手产品经理

THIS IS RENO

Print Array in a Loop - 41 Days - Learn Python Online in 100 Days

Record#

  1. Today I learned about arrays, 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 keys and values in the items() function.
  4. Today's practice involves storing data in a dictionary and then printing it.
  5. 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} ")
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.