Python 可以生成具有给定条件的所有可能零件号的列表吗?
我是Python新手。就像真正的新事物一样,只是冒险是否可以在我的工作中使用这种语言。
Python 可以从此列表中生成所有可能的零件号吗?
条件:
- 角色已订购
可以有ERJ3RBD1002V,但不能有3RERJBD1002V。
太感谢了。
I am new to Python. As in really new, just venturing if I can use this language in my work.
Can Python generate all the possible part numbers from this list?
Condition:
- Characters are ordered
It can have ERJ3RBD1002V, but not 3RERJBD1002V.
Thank you so much.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
是的,可以,但电阻值部分(8、9、10、11)除外,因为这些可以是完整的值列表,并且您提供的链接未列出它们。
这是一个简单的代码来做到这一点。它将把
RRRR
放入电阻值部分。如果您有电阻值列表,只需将它们添加到列表R
中,它将使用它们来创建组合:为了清楚起见,我在各部分之间添加了额外的空格,但如果您愿意,可以删除它们
Yes it can, except for the resistance values part (8,9,10,11) since those can be a whole list of values and the link you provided doesn't list them.
Here is a simple code to do it. It will put
RRRR
into the resistance value part. If you have a list of resistance values, just add them to listR
and it will use those to create the combinations:I put in extra spaces between sections for clarity but you can remove them if you like