Zeno___Lee 发表于 2020-4-1 22:36

醉乡不怕套路深 发表于 2020-4-1 22:53

厉害,是自学吗?

hack88888888 发表于 2020-4-1 22:53

感谢分享

Zeno___Lee 发表于 2020-4-1 22:54

446917139 发表于 2020-4-1 23:06

感觉这些比较基础,可以顺便练习一下可视化? 比如matplotlib或者seaborn绘制个柱状图饼图啥的

Zeno___Lee 发表于 2020-4-2 08:39

jerome970520 发表于 2020-4-2 15:50

自己看吧
def func(you,he):
    if you == he:
      print(f'平局,robot:{he}')
    elif you == '布' and he == '石头':
      print(f'你赢了,robot:{he}')
    elif you == '石头' and he == '剪刀':
      print(f'你赢了,robot:{he}')
    else:
      print(f'你输了,robot:{he}')

Zeno___Lee 发表于 2020-4-3 08:03

Kelepangxie 发表于 2020-7-28 17:30

本帖最后由 Kelepangxie 于 2020-7-28 18:31 编辑

请问我这个怎么修改,刚学第一天....

print("剪刀=0,石头=1,布=2" "\n" "请输入0,1,2",)
x =int(input() )
import random
xiTong = random.randint(0, 2)

if(xiTong - x ==1 ):
    print(xiTong)
    print( "you lose")
elif(xiTong - x ==0):
    print(xiTong)
    print("again")
elif ( x-xiTong == -1):
    print(xiTong)
    print("you lose")
elifint (x-xiTong ==-2):
    print(xiTong)
    print("you win")
elifint (x-xiTong ==1):
    print(xiTong)
    print("you win")
elif int(x - xiTong == 2):
    print(xiTong)
    print("you win")
elif int(x < 0):
    print("请输入数字012")
else:
    print("请输入数字012")
页: [1]
查看完整版本: 【原创源码】【Python】 当习题写的一个剪刀石头布