python第一天作业
作者:互联网
1.5个输入输出
(1)
data1 = "英雄联盟登陆首页"
data2 = "-*" * 25
data3 = "1.进入英雄超市"
data4 = "2.休闲小游戏"
data5 = "3.退出系统"
print(f'{data1:^50}')
print(f'{data2:^50}')
print(f'{data3:^50}')
print(f'{data4:^50}')
print(f'{data5:^48}')
print(f'{data2:^50}')
input("(温馨提示)请输入你的选择:")
(2)
data1 = "英雄商城英雄列表"
data2 = "~*" * 35
data3 = "编号 姓名 昵称 价格 库存 描述"
data4 = "1 纳尔 迷失之牙 3500 100 丛林不会原谅盲目与无知 "
data5 = "2 锐雯 放逐之刃 4000 100 她是残忍高效的战士 "
data6 = "3 薇恩 暗夜猎手 3500 100 这个世界不想人们想象的那么美好"
data7 = "4 扎克 生化魔人 3000 100 即使你没有脊柱,你也必须站起来"
data8 = "5 杰斯 未来守护者 2500 100 武装着睿智与魅力,你的选择没有错"
print(f'{data1:^70}')
print(f'{data2:^70}')
print(f'{data3}')
print(f'{data4}')
print(f'{data5}')
print(f'{data6}')
print(f'{data7}')
print(f'{data8}')
print(f'{data2:^70}')
input("(温馨提示)请输入您需要买的英雄编号:")
(3)
print("英雄详情")
print("购买页面")
data1 = "英雄商城购买英雄"
print(f'{data1:^100}')
data2 = "-*" * 62
print(f'{data2}')
data3 = "英雄名称:盲僧(史诗)"
print(f'{data3:^50}')
data4 = "英雄属性:生命值428(+85)/能量值200(+0)/移动速度425/攻击力55.8(+3.2)攻击速度0.651(+3.1%)/护甲值24(+1.25)/攻击距离125"
print(f'{data4:^124}')
print("")
data6 = "英雄座右铭:一人之行可灭世,众人之勤可救世!"
print(f'{data6:^60}')
data7 = "英雄价格:3000"
print(f'{data7:^48}')
data8 = "活动折扣:9.5"
print(f'{data8:^46}')
print("")
data9 = "插播广告:当风云变色,当流离失所,世界不再是旧日模样"
print(f'{data9:<50}')
data10 = "你是否会为了自己的梦想战斗,直至力战身亡,直至彼岸他乡"
print(f'{data10:<50}')
print(f'{data2}')
input("(温馨提示)请付款:")
(4)
data1 = "订单页面:打印小票"
print(f'{data1:^100}')
print()
data2 = "英雄商城购买英雄"
print(f'{data2:^100}')
data3 = "英雄购买票据"
print(f'{data3:^20}')
data4 = "~*" * 50
print(data4)
data5 = "英雄名称:九尾妖狐(史诗)"
data6 = "英雄价格:10000"
data7 = "活动折扣:9.5"
print(f'{data5:^100}')
print(f'{data6:^96}')
print(f'{data7:^94}')
print()
data8 = "应付付款:9500"
data9 = "实际付款:10000"
data10 = "找零:500"
print(f'{data8:^96}')
print(f'{data9:^96}')
print(f'{data10:^92}')
data11 = "插入广告:当风云变色,当流离失所,世界不再是旧日模样"
print(f'{data11:^40}')
data12 = "你是否会为了自己的梦想战斗,直至力战身亡,直至彼岸他乡 "
print(f'{data12:^42}')
print(data4)
input("(温馨提示)按任意键返回上一级:")
(5)
data1 = "英雄联盟登陆界面"
data2 = "-*" * 25
data3 = "1.用户登录"
data4 = "2.新用户注册"
data5 = "3.退出系统"
print(f'{data1:^50}')
print(f'{data2:^50}')
print(f'{data3:^48}')
print(f'{data4:^50}')
print(f'{data5:^48}')
print(f'{data2:^50}')
input("(温馨提示)请输入你的选择:")
2.a,b交换值
(1)
a, b = map(int, input("请输入a,b的值:").split(","))
a, b = b, a
print("a=", a, "b=", b)
(2)
a = 5
b = 6
c = a
a = b
b = c
print(a, b)
(3)
a = 5
b = 6
a = a + b
b = a - b
a = a - b
print(a, b)
3.python配置环境变量
我的电脑右键选择属性,进入高级选项点击环境变量
在系统变量里选择新建
变量值需要输入两个
1)、C:\Users\Administrator\AppData\Local\Programs\Python\Python39
2)、C:\Users\Administrator\AppData\Local\Programs\Python\Python39\Scripts
然后点击应用
win+r 输出cmd
输入python查看
标签:第一天,python,作业,50,英雄,print,data4,data1,data2 来源: https://blog.csdn.net/m0_56224449/article/details/122383441