域名生成

# 域名生成:
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()

转载于:https://www.cnblogs.com/victorstudy/p/11425873.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值