The decision making concept is the ability to decide upon something based on the given data. Here the program uses various comparators like , <=, ==,>= etc to decide on something that matters the most based on the input given by the program. A tutorial is attached below.Decision making is dealing with several types of conditions that used to occurs at the time of program execution. Decision structures evaluate multiple expressions which produce result in from of either True or False.
Here we will take an example of cricket match
Here we will write a program to say which team can chase what score. Here we input the score at the beginning, in this case score = 190. Later we "if" "else" keywords with the comparator "=="(equal to) and "<" (less than) to write a program in python as to which team would be able to chase the score given.
In [3]:
score = 190
In [4]:
if score < 160:
print ("Score is less than 190")
if score == 180:
print ("CSK can chase it.")
elif score == 160:
print ("MI can chase it.")
elif score == 140:
print ("DD can chase it.")
elif score < 130:
print ("Score is less than 130")
else:
print ("What's the ideal score to chase??")
print ("Find out, @ #IPL!")
In [ ]: