I try to prepare a questionnaire of 5 yes no questions.
The problem is after the result line at the end there are 5 lines only written as None.
The code is ![]()
answers = [βYesβ, βNoβ]
question_1 = tab_2.radio(β1.tired.β, answers)
tip_1.append(1) if question_1 == βYesβ else tip_1.append(0)
question_2 = tab_2.radio(β2.dizzy.β, answers)
tip_5.append(1) if question_2 == βYesβ else tip_5.append(0)
question_3 = tab_2.radio(β3.Nausea.β, answers)
tip_9.append(1) if question_3 == βYesβ else tip_9.append(0)
question_4 = tab_2.radio(β4.Vomit.β, answers)
tip_2.append(1) if question_4 == βYesβ else tip_2.append(0)
question_5 = tab_2.radio(β5.Headache.β, answers)
tip_8.append(1) if question_5 == βYesβ else tip_8.append(0)
sum_lists = [sum(tip_1), sum(tip_2), sum(tip_3), sum(tip_4), sum(tip_5), sum(tip_6), sum(tip_7), sum(tip_8), sum(tip_9)]
max_list_index = sum_lists.index(max(sum_lists))
tab_2.write(f"Your type is tip{max_list_index + 1}")
In the website, after the result line there are 5 lines of None
None
None
None
None
I couldnβt get rid of them.
I have three tabs and I have these five None line in each of the tabs.
Could you please help me?