Describe the difference between a chained conditional and a nested conditional. Describe a strategy to avoid nested conditions. Give an example of a nested conditional that can be changed to a single conditional, and show the equivalent unique conditional
1
Expert's answer
2020-05-01T14:44:37-0400
a = 1b = 2ifa == 1:
ifb == 2: #It will only be executed ifa = 1print('Yes')
ifa == 1 and b == 2:
print('Yes') #It will only be executed if (a = 1 AND b = 2)
Comments