Python
HanSmileLiao
追逐繁星
展开
-
Python利用遍历法查找列表中某一特定元素
Python利用遍历法查找列表中某一特定元素 #Searching element from list by traversal from random import * Flag=1 times_Appear=0 while Flag: list_Length=int(input("Enter the length of list(Length>=25) :")) if list_Length<25: print("Length doesn't meet the原创 2021-09-22 00:19:20 · 474 阅读 · 0 评论 -
石头剪刀布
**关于“石头剪刀布”的一点点思考** 人尽皆知的“石头剪刀布”游戏,一共两个玩家,而运行结果无非三种,A赢,B赢,平局,也就是说说三种结果的概率理论上应该都是1/3,总共有3X3=9中组合方式,下面用Python模拟这个过程 #Possiblity of mora game from random import * mora_GamerA=["Rock","Paper","Scissor"] mora_GamerB=["Rock","Paper"...原创 2021-09-20 13:07:40 · 146 阅读 · 0 评论