The document discusses how decisions are made based on conditions. It shows examples of children playing games where their actions depend on conditions like the card picked or its properties. The conditions can be true or false and involve comparisons between values, variables and logical operations like AND, OR and NOT. Basic logical and relational operators like ==, !=, <, >, <= are presented along with examples.
6. HOW DO WE MAKE DECISIONS?
If some condition is True,!
then I will perform some action
7. First, Leena will pick a card
If the card Leena picked is a black card,
First, Koena will jump up twice
After that, Sahith will clap three times
After that, Rohin will write gigglygoo on a piece of paper
Otherwise,
First, Ishaan will say, I will put on the cloak !
and enter the Forbidden Forest
After that, Suneet will draw a circle on a whiteboard
8. card = Leena.pickCard()
if card.color == black:
Koena.jump(2)
Sahith.clap(3)
Rohin.write(gigglygoo)
else:
Ishaan.say(I will put on the cloak !
and enter the Forbidden Forest)
Suneet.draw(circle)
9. First, Leena will pick a card
If the card Leena picked is a black face card,
First, Sahith will say, Hi! My name is Fluffy
After that, Rohin will do three jumping jacks
Otherwise, if the card Leena picked is a red face card,
First, Suneet will clap 4 times
After that, Koena will draw a flower on a whiteboard
Otherwise,
Ishaan will imitate a tree for 5 seconds
10. card = Leena.pickCard()
if card.color == black AND card.isFaceCard():
Sahith.say(Hi! My name is Fluffy)
Rohin.doJumpingJacks(3)
elif card.color == red AND card.isFaceCard():
Suneet.clap(4)
Koena.draw(flower)
else:
Ishaan.imitate(tree, 5)
11. card = Leena.pickCard()
Sahith.clap(2)
if card.isNumberCard() AND card.number == 6:
Koena.say(I am not a zombie)
Suneet.doJumpingJacks(4)
elif card.isNumberCard() AND card.number == 7:
Rohin.imitate(vampire, 4)
elif card.isNumberCard() AND card.number == 8:
Ishaan.jump(3)
else:
Suneet.imitate(bird, 4)
Koena.clap(3)