二手产品经理

二手产品经理

THIS IS RENO

Array Practice - 42 Days - Learn Python 100 Days Online

Record#

  1. Today there is no knowledge learning, only programming training.
  2. Write a dictionary for Pokémon with input and print functions. When printing, output text in corresponding colors based on pet attributes.
  3. Still not proficient in alignment, need more practice.

CODE#

print("👾 MokéBeast - The Non-Copyright Generic Beast Battle Game 👾")
print()

def color(c):
  if c == "fire":
    print("\033[31m")
  if c == "water":
    print("\033[34m")
  if c == "electricity":
    print("\033[33m")
  if c == "grass":
    print("\033[32m")
  if c == "poison":
    print("\033[35m")

moke = {"name":None, "type":None, "move":None, "HP":None, "MP":None, }

for name in moke.keys():
  moke[name]=input(f"Input your beast's {name} > ")

for name,value in moke.items():
  color(moke['move'])
  print(f"{name: <15}:{value}")
Loading...
Ownership of this post data is guaranteed by blockchain and smart contracts to the creator alone.