0
远离python一段时间,因此格式化技能不存在。展望把这个格式的东西:格式化为3SAT格式表
[[8, -6, -4], [-10, 4, 6], [6, -8, -9]]
到的东西,看起来像这样:
(x8 v ~x6 v ~x4)^(~x10 v x4 v x6)^(x6 v ~x8 v ~x9)
,然后能够引用的每个数字作为单独的输入改为T或F.任何指导意见会很高兴。
import random
def sample():
nums = random.sample(range(-10, 10), 3)
return nums
exlist = []
boundary = random.randint(3, 10)
count = 0
while (count < boundary):
count = count + 1
exlist.append(sample())
我不知道如何生成一个随机列表与否定并排除零。 –