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())
我不知道如何生成一個隨機列表與否定並排除零。 –