域名生成

无人久伴 提交于 2019-11-28 20:10:15
# 域名生成:import string'''   1.可以生成hg000.com   2.重在数字的添加 '''def f1():    input_wd = input('请输入要生成网站的关键字:')    for i in range(1111, 10000):        print('00' + str(i) + input_wd + '.com')        print(input_wd + str(i) + '.com')        print(str(i) + input_wd + '.com')'''    1. 该方法可生成类似hga.com/hgb.com的域名    2.从a到z 字母的添加'''def f2():    input_wd = input('请输入要生成网站的关键字:')    for word in string.ascii_lowercase:        domain_list = input_wd + word + '.com' + '\n'        for domain in domain_list:            print(domain, end='')def f3():    input_wd = input('请输入要生成网站的关键字:')    for i in range(1, 10000):        if i < 10:            domain = input_wd + '0' + str(i) + '.com'        elif i <= 100:            domain = input_wd + str(i) + '.com'        elif 200 <= i <= 999:            domain = input_wd + '0' + str(i) + '.com'        else:            domain = input_wd + str(i) + '.com'        print(domain)def f4():    input_wd = input('请输入要生成网站的关键字:')    for i in range(1, 10000):        if i < 10:            domain = input_wd + str(i) + '.com'        elif i <= 100:            domain = input_wd + str(i) + '.com'        elif 200 <= i <= 999:            domain = input_wd + '0' + str(i) + '.com'        else:            domain = input_wd + str(i) + '.com'        domain = input_wd + str(i) + '.com'        domain = input_wd + str(i) + '.net'        print(domain)def f5():    input_wd = input('请输入要生成网站的关键字:')    for word in string.ascii_lowercase:        # domain_list = input_wd + word*2 + '.com' + '\n'        domain_list = input_wd + word + '.com' + '\n'        # domain_list = word + input_wd + '.com' + '\n'        for domain in domain_list:            print(domain, end='')if __name__ == '__main__':    f4()
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!