我需要根据用户的决定更新表。我需要知道如何根据用户输入的内容更改单元格中的文本

时间:2019-05-27 17:25:16

标签: python

我在Python上面临危险。我需要显示已经完成的问题。在下面,我有一部分代码,但是每次完成问题时,我都需要更新表。

x = texttable.Texttable()
x.add_rows([["Music", "Movies", "Sports"], [10, 10, 10], [50, 50, 50], [100, 100, 100]])
table = x.draw()
print table

 user1 = raw_input("\n\n" + play1 + " choose a question:")
  if user1 in done_questions:
    print "This question is already done. Enter another question."
    continue
  elif user1 == "0":
    print "Thank You for Playing."
    break
  else:
    if user1 == "Music 10" or user1 == "music 10":
      answer1 = raw_input("Which artist had the top 3 songs on the billboard since after 'The Beatles'.\n")
      if answer1 == "Ariana Grande" or answer1 == "ariana grande":
        print "You got it right!"
        done_questions.append(user1)
        point_1 += 10
      else:
        print "Sorry. It's Wrong."

0 个答案:

没有答案