九九乘法表
i=1
while i<=9:
j=1
while j<=i:
print(j,"",i,"=",ji,end=" ")
j+=1
print()
i+=1
猜拳
peason=int(input(“请出拳(1:石头)(2:剪刀)(3:布)”))
computer=1
while peason<1 or peason>3:
peason=int(input(“输入错误,请再输入一次:”))
continue
if (peason1 and computer2) or (peason2 and computer3) or (peason3 and computer1):
print(“电脑输了!”)
elif peason==computer:
print(“平局!”)
else:
print(“电脑赢了!”)
实心方框
for i in range(5):
for j in range(5):
print("*",end=" ")
print()
函数调用
def one():
print(“one-----start”)
def two():
print(“two-----start”)
one()
print(“two-----end”)
def three():
print(“three-----start”)
two()
print(“three-----end”)
three()