user_input_1 = string(input(“Y/N”))
user_input_2 = string(input(“Y/N”)
...
user_input_10 = string(input(“Y/N”))
Assuming that for each combination of inputs the code has to do another calculation, how do you avoid multiple if-elif-else?
For example:
if user_input_1 == “Y”:
if user_input_2 == “Y”:
if user_input_3 == “Y”:
do_this()
...
elif user_input_2 == “N”:
do_that()
...
elif user_input_1 == “N”:
...
....
Going this way does not seem effective, because I will end up with hundreds of ifs
“, which is actually invalid in python code.