首页 > IT职业 > IT职场 > python实现舒尔特方格
# -*- 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/ ,如需转载,请注明出处,否则将追究法律责任。