concept decision in category python

This is an excerpt from Manning's book Get Programming: Learn to code with Python.
Making decisions—When you have multiple statements, you can make decisions based on whether one statement is true by using if...then. For example, “if it is raining, then the ground is wet” is made up of two statements: “it is raining” and “the ground is wet.” The statement “the ground is wet” is a consequence of the statement “it is raining.” Following flowcharts—You won’t need to know flowcharts to understand this book, but understanding them requires the same skills as understanding basic programming. Other ideas that use the same skill set are playing the game of 20 Questions, following a recipe, reading a choose-your-own-adventure book, or understanding algorithms. You should be familiar with following a set of instructions and making branching decisions. Flowcharts show a list of instructions that flow from one to the next and allow you to make decisions, which lead to different paths. In a flowchart, you’re asked a series of questions, whose answer is one of two choices: yes or no. Depending on your answer, you follow certain paths through the flowchart and will eventually end up at a final answer. Figure 1.1 is an example of a flowchart.
Understand how the Python interpreter makes decisions

This is an excerpt from Manning's book Hello App Inventor!: Android programming for kids and the rest of us.
Block drawer
Blocks you’ll find in there
Explanation and example
Control Decision blocks that tell the program what to do next based on some kind of test Loops, which are a powerful way of repeating tasks Decision: If you clicked the Happy button, the phone sends a tweet. If you clicked Sad, it sends a
tweet. Loop: When you text a group of contacts, the phone executes a loop from the first contact to the last, sending a single text each time. Doing this manually would be tedious!
Logic The logic values True and False Logical tests: AND, OR, NOT, = True and False can set properties. For example, setting a button’s Visible property to False makes the button disappear. Logical tests are used for more complicated Decision blocks. For example, you might want to make sure the user’s age is more than 8 AND less than 12. Math Blocks that create and compare numbers, plus all the functions you would find on a calculator For example, in a game you could use Math blocks to add up the number of coins collected and convert this to a score. You could also use Math blocks to work out whether this score was greater than the current high score. Text Blocks that create, change, add, join, split, replace, and compare text Any piece of text you want to display is created in a Text block. For example, you could join the name a user typed and a text message—something like, “Hello Amy, how are you today?” Lists Blocks that store, display, and work with lists of things For example you might want to give the user a menu of choices that they can click. Colors A choice of standard colors to use[a] You can set or change the color of anything you see on screen, like text, a button, or the background. Variables Blocks to create variables A variable is a named storage space for a small piece of data like your name or age or a game score. Procedures Blocks to create and run procedures A procedure is a kind of mini program that other blocks can start. For example, you might have a procedure that resets the screen whenever a game is over.
Chapter 5. Variables, decisions, and procedures
In this chapter, we’ll experiment with three powerful programming ideas. First we’ll look at how programs can remember and use pieces of information using variables. You’ll learn how programs can ask questions and make decisions using comparison operators and control blocks. Then we’ll look at how you can split up programs into reusable chunks called procedures, and why you will want to do this. Along the way, we’ll also look at some debugging and commenting tools that will help you troubleshoot pesky errors (programmers spend lots of their time doing this).

This is an excerpt from Manning's book Hello! Python.
With finish_caves, you haven’t created a convenience function
. It’s the only section of code where you create a one-way tunnel, so the benefit is a bit more limited than in the other cases. Whether you create a function in cases like this might depend on whether you were planning on adding more functionality later. Decisions like this can be something of a stylistic issue, so pick the option that feels best for you. You can always change it later if you need to repeat some code.
tweet. If you clicked Sad, it sends a
tweet. Loop: When you text a group of contacts, the phone executes a loop from the first contact to the last, sending a single text each time. Doing this manually would be tedious!
. It’s the only section of code where you create a one-way tunnel, so the benefit is a bit more limited than in the other cases. Whether you create a function in cases like this might depend on whether you were planning on adding more functionality later. Decisions like this can be something of a stylistic issue, so pick the option that feels best for you. You can always change it later if you need to repeat some code.