|
马上注册,结交更多好友,享用更多功能^_^
您需要 登录 才可以下载或查看,没有账号?立即注册
x
本帖最后由 shiyouroc 于 2022-3-7 14:59 编辑
密码生成器v2.9
问题:
1.代码不简洁。
2.功能不多。
- # coding=utf-8
- #!/usr/bin/python
- # Write Python 3 code in this online editor and run it.
- from random import randint
- from sys import exit
- yes=1
- ye=1
- xiao=['a','b','c','d','e','f',
- 'g','h','i','j','k','l',
- 'm','n','o','q','p','r',
- 't','s','u','v','w','x','y',
- 'z']
- da=['A','B','C','D','E','F',
- 'G','H','I','J','K','L',
- 'M','N','O','P','Q','R',
- 'T','U','S','V','W','X','Y',
- 'Z']
- def three_engling():
-
- global yes
- global ye
- yes = input("是1退0")
- ye = yes.isdigit()
- print(ye)
-
- def tt():
- global yes
- global ye
-
- while ye == False:
- print('请勿非法输入。')
- yes = input("是1退0")
- ye = yes.isdigit()
- print('请勿非法输入。')
- if ye == False:
- cc()
- else:
- break
- def dd():
- global yes
- yes = int(yes)
- if yes > 1:
- print('请勿非法输入。')
- cc()
-
- if yes ==0:
- exit(0)
- def sc():
- y=randint(0,2)
-
- if y==0:
- d=randint(0,25)
- one=xiao[d]
- else:
- d = randint(0,25)
- one = da[d]
-
- if y==1:
- q= randint(0,25)
- two = xiao[q]
- else:
- q = randint(0,25)
- two = da[q]
-
-
- if y==2:
- z=randint(0,25)
- three=xiao[z]
- else:
- z=randint(0,25)
- three=da[z]
-
- numbers = randint(1000000,99999999)
-
- g=str(one)+str(two)+str(three)+'.'+str(numbers)
- print(g)
- cc()
-
-
-
- def cc():
- three_engling()
- tt()
- dd()
- sc()
-
- cc()
-
复制代码
@python爱好者.
@nizitao |
|