还有一个菜鸟问题 [英] yet another noob question
问题描述
我想在5
位数字中生成数字1-5的每个唯一组合,并使用换行符跟随每个组合。所以我看着
产生的组合如:(12345),(12235),(55554)等等。
什么是最好的方法做这个?所以,基本上我正在寻找一个5位数唯一数字中1-5的所有组合的
列表。另外,当我发送列表打印时,我不会有任何重复的组合。
谢谢,
Mike
I would like to generate every unique combination of numbers 1-5 in a 5
digit number and follow each combo with a newline. So i''m looking at
generating combinations such as: (12345) , (12235), (55554) and so on.
What would be the best way to do this? So, basically i''m looking for a
list of all combinations of 1-5 in a 5 digit unique number. Also, when
I send the list to print there can''t be any duplicates of the combos.
Thanks,
Mike
推荐答案
mike_wilson1333 schrieb:
mike_wilson1333 schrieb:
我想要在5
位数字中生成数字1-5的每个唯一组合,并使用换行符跟随每个组合。所以我看着
产生的组合如:(12345),(12235),(55554)等等。
什么是最好的方法做这个?所以,基本上我正在寻找一个5位数唯一数字中1-5的所有组合的
列表。另外,当我发送列表打印时,我不会有任何重复的组合。
谢谢,
>
Mike
I would like to generate every unique combination of numbers 1-5 in a 5
digit number and follow each combo with a newline. So i''m looking at
generating combinations such as: (12345) , (12235), (55554) and so on.
What would be the best way to do this? So, basically i''m looking for a
list of all combinations of 1-5 in a 5 digit unique number. Also, when
I send the list to print there can''t be any duplicates of the combos.
Thanks,
Mike
一般情况下,它是范围(11111,5555)
此致,
Stargaming
-
Generally, it is range(11111, 55555)
Sincerely,
Stargaming
--
mike_wilson1333写道:
mike_wilson1333 wrote:
I想要在5
数字中生成数字1-5的每个唯一组合,并使用换行符跟随每个组合。所以我看着
产生的组合如:(12345),(12235),(55554)等等。
什么是最好的方法做这个?所以,基本上我正在寻找一个5位数唯一数字中1-5的所有组合的
列表。另外,当我发送列表打印时,我不会有任何重复的组合。
谢谢,
>
Mike
I would like to generate every unique combination of numbers 1-5 in a 5
digit number and follow each combo with a newline. So i''m looking at
generating combinations such as: (12345) , (12235), (55554) and so on.
What would be the best way to do this? So, basically i''m looking for a
list of all combinations of 1-5 in a 5 digit unique number. Also, when
I send the list to print there can''t be any duplicates of the combos.
Thanks,
Mike
Mike,这是其中之一有人必须遇到这个问题
在我之前有点情况。谷歌在蟒蛇组合而你
应该得到很好的回报。 :-)
和平,
~西蒙
Hi Mike, this is one of those "Somebody must have had this problem
before me" kind of situations. Google on "python combination" and you
should be well rewarded. :-)
Peace,
~Simon
mike_wilson1333:
mike_wilson1333:
>我想生成数字1-5的每个独特组合,这是一个5位数字[...]什么是最好的方法做这个?
>I would like to generate every unique combination of numbers 1-5 in
a 5 digit number [...] What would be the best way to do this?
请求Java新闻组设计一个聪明的算法并在此处发布
pythonification。请求伪代码,而不是Java代码。
-
$ b $bRenéPijlman
Ask the Java newsgroup to design a clever algorithm and post it here for
pythonification. Ask for the pseudocode, not the Java code.
--
René Pijlman
这篇关于还有一个菜鸟问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!