简单小程序的实现:
- 九九乘法表:
-
1 for i in range(1,10): 2 for j in range(1,i+1): 3 print(‘%d*%d=%d‘%(j,i,j*i),end=‘\t‘) 4 print()
-
- 定义一个登录函数
-
-
def login(username,password): if (username==‘alex‘ and password==‘123‘): print(‘用户名密码正确,登录成功‘) else: print(‘请输入正确的用户名和密码‘) username = input(‘input you username:‘) password = input(‘input your password:‘) login(username,password)
-
原文地址:https://www.cnblogs.com/xiaoyan-alex/p/10087485.html
时间: 2024-10-07 13:04:40