{ "type": "code_options", "author": "csdn.net", "source": "solution.md", "exercise_id": "3409457ad91d4b4e96d77dfef1cc52cc", "keywords": "图算法,算法高阶,最小生成树,最小生成树的形成", "title": "生成100个2位随机正整数", "desc": [ { "content": "\n

生成100个2位随机正整数,按每行十个输出,并求出个位数字分别为0,1,2,3,4,5,6,7,8,9的正整数的个数

", "language": "markdown" } ], "answer": [ { "content": "", "language": "python" } ], "prepared": [ [ { "content": "", "language": "python" } ], [ { "content": "", "language": "python" } ], [ { "content": "", "language": "python" } ] ], "template": { "content": "import random\ndef fun():\n\trandom_list = [random.randint(10, 99) for n in range(100)]\n\tstatistics = {n: 0 for n in range(10)}\n\tfor index, x in enumerate(random_list):\n\t\tprint(x, end=' ')\n\t\tstatistics[int(x % 10)] = statistics[int(x % 10)] + 1\n\t\tif ((index + 1) % 10 == 0):\n\t\t\tprint()\n\tprint(statistics)\nif __name__ == '__main__':\n\tfun()", "language": "python" }, "node_id": "dailycode-bb13d528854f425581da02db1f7f053b", "license": "csdn.net", "created_at": 1637894161, "topic_link": "https://bbs.csdn.net/topics/600470401" }