\n\n问题:
\n
\n
\n倍数列表
\n创建一个 Python 3 函数,该函数接受两个数字(值、长度)作为参数,并返回值的倍数列表,直到列表的大小达到 length。
\n
\n示例
\nlist_of_multiples(value=7, length=5)
\xe2\x9e\x9e[7, 14, 21, 28, 35]
\n
\nlist_of_multiples(value=12, length=10)
\xe2\x9e\x9e[12, 24, 36, 48, 60, 72, 84, 96, 108, 120]
\n
\nlist_of_multiples(value=17, length=6)
\xe2\x9e\x9e[17, 34, 51, 68, 85, 102]
def multiples (value,length):\n """\n Value is number to be multiply\n length is maximum number of iteration up to\n which multiple required.\n """\n for i in range(length):\n out=i\n return i\n
Run Code Online (Sandbox Code Playgroud)\n python ×1