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?