ITPub博客

首页 > IT职业 > IT职场 > python实现舒尔特方格

python实现舒尔特方格

IT职场 作者:古月雪 时间:2021-09-09 09:29:18 0 删除 编辑

# -*- coding: utf-8 -*-from __future__ import print_function"""    package.module    ~~~~~~~~~~~~~~    舒尔特方格 25 / 36 / 49 / 64    # 5 * 5如下, 即25个元素打乱后取值即可。"""import randomdef schulte(n):    '''return n*n'''    # 打乱数字    max = n * n    numbers = list(range(1, max+1)) # 兼容py3    random.shuffle(numbers)    # 格式化输出    print()    print('-' * 25)    i = 0    while i 

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/3711/viewspace-2803574/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论

注册时间:2019-07-09

  • 博文量
    160
  • 访问量
    1173