Commit f0026911 by BellCodeEditor

auto save

parent 25abb509
Showing with 40 additions and 3 deletions
def vowel(word):
if word.find('a')>=0 or word.find('e')>=0 or word.find('i')>=0 or word.find('o')>=0 or\
word.find('u')>=0:
return word
f2 = filter(vowel,['python','php','java','c++','html'])
print(list(f2))
\ No newline at end of file
import random
l1 = []
for i in range(random.randint(1,100)):
a = random.randint(1,9)
l1.append(a)
print(l1)
print('l1的长度是:'+str(len(l1)))
print('数字和为:'+str(sum(l1)))
\ No newline at end of file
player=input("请出拳:石头/剪刀/布")# 玩家出拳
print("玩家出拳:"+player)
\ No newline at end of file
import random
while True :
player=input("请出拳:(石头/剪刀/布)")# 玩家出拳
print("玩家出拳:"+player)
a=["石头","剪刀","布"]
g=random.choice(a)
print("电脑出拳:"+g)
if player in a :
if player==g:
print("平局")
elif player=="石头" and g=="剪刀":
print("玩家赢")
elif player=="剪刀" and g=="布":
print("玩家赢")
elif player=="布" and g=="石头":
print("玩家赢")
else :
print("玩家输")
else :
print("输入错误")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment