二手产品经理

二手产品经理

THIS IS RENO

在线学Python100天 - 第5周第三天

记录#

  1. 今天没有新的知识点。练习是综合运用 print 知识点,打印 2 个用户登录页面。
  2. 知识点有颜色,对齐

CODE#

def vtext(c):
  if c == "red":
    return ("\033[31m")
  elif c == "blue":
    return ("\033[34m")
  elif c == "purple":
    return ("\033[35m")
  elif c == "green":
    return ("\033[32m")
  elif c == "yellow":
    return ("\033[33m")
  else:
    return ("\033[0m")


mtitle = f"{vtext('red')}={vtext('w')}={vtext('blue')}= {vtext('yellow')} Music App {vtext('blue')}={vtext('w')}={vtext('red')}="
m1 = f"{vtext('w')} Radio Gaga"
m2 = f"{vtext('yellow')} Queen"
m3 = f"{vtext('w')} PREV"
m4 = f"{vtext('green')} NEXT"
m5 = f"{vtext('purple')} PAUSE"

print(f"{mtitle: >60}")
print()
print("🔥 ▶️", end="")
print(f"{m1: >15}")
print(f"{m2: >15}")
print()
print()
print(f"{m3: >5}")
print(f"{m4: >15}")
print(f"{m5: >21}")
print("----------------------")
t1 = f"{vtext('w')} WELCOME TO"
t2 = f"{vtext('blue')} --   ARMBOOK   --"
t3 = f"{vtext('yellow')} Definitely not a rip off of"
t31 = f"{vtext('yellow')} a certain other social."
t32 = f"{vtext('yellow')}  networking site"
t4 = f"{vtext('red')} Honest."
t5 = f"{vtext('w')} Username:"
t6 = f"{vtext('w')} Password:"
print(f"{t1: ^40}")
print(f"{t2: ^40}")
print()
print(f"{t3: >35}")
print(f"{t31: >35}")
print(f"{t32: >35}")
print()
print(f"{t4: ^40}")
print()
print(f"{t5: ^38}")
print(f"{t6: ^38}")

加载中...
此文章数据所有权由区块链加密技术和智能合约保障仅归创作者所有。