print('Hello wo# ========== 任务 0 预热 ==========
age = 20
height = 1.65
nickname = "Lily"
is_student = True
print(type(age), id(age))
print(type(height), id(height))
print(type(nickname), id(nickname))
print(type(is_student), id(is_student))
a = 5
b = 5
print(a == b)
print(a is b)
# ========== 任务 1:个人信息脱敏 ==========
name = input("输入姓名:")
id_card = input("输入身份证号:")
phone = input("输入手机号:")
# 姓名脱敏
name_hide = name[0] + "*" * (len(name) - 1)
# 生日 yyyy-mm-dd
birth = id_card[6:10] + "-" + id_card[10:12] + "-" + id_card[12:14]
# 手机号脱敏
phone_hide = phone[:3] + "****" + phone[-4:]
# ========== 任务 2:五天步数统计,独立变量 ==========
nick = input("输入昵称:")
day1 = int(input("第1天步数:"))
day2 = int(input("第2天步数:"))
day3 = int(input("第3天步数:"))
day4 = int(input("第4天步数:"))
day5 = int(input("第5天步数:"))
total = day1 + day2 + day3 + day4 + day5
avg = total / 5
max_step = max(day1, day2, day3, day4, day5)
# ========== 任务 4:商品结算 ==========
price = float(input("商品单价:"))
num = int(input("购买数量:"))
ori = price * num
if ori >= 100:
pay = ori * 0.9
else:
pay = ori
# ========== 任务 3 + 5:f-string 排版,完整报告 ==========
print("-" * 50)
print(f"{'个人健康消费报告':^50}")
print("-" * 50)
print(f"{'脱敏姓名':<10}{name_hide:^12}{'生日':<10}{birth}")
print(f"{'脱敏手机':<10}{phone_hide}")
print("-" * 50)
print(f"{'昵称':<10}{nick}")
print(f"{'总步数':<10}{total:<10}{'平均步数':<10}{avg:.2f}")
print(f"{'最大步数':<10}{max_step}")
print("-" * 50)
print(f"{'原价':<10}{ori:.2f}{'实付金额':<10}{pay:.2f}")
print("-" * 50)
rld!')
To embed this project on your website, copy the following code and paste it into your website's HTML: