From e4bff66f890fa6d89dac23714148f2e5588d8a93 Mon Sep 17 00:00:00 2001 From: Alishaan Ali Date: Fri, 9 Nov 2018 11:03:10 -0500 Subject: [PATCH] Slight Grammatical Changes on if-elif-else-statements (#21222) - [x] I have read [freeCodeCamp's contribution guidelines](https://github.com/freeCodeCamp/freeCodeCamp/blob/master/CONTRIBUTING.md). - [x] My pull request has a descriptive title (not a vague title like `Update index.md`) - [x] My pull request targets the `master` branch of freeCodeCamp. - [x] None of my changes are plagiarized from another source without proper attribution. - [x] My article does not contain shortened URLs or affiliate links. If your pull request closes a GitHub issue, replace the XXXXX below with the issue number. Closes #XXXXX --- guide/english/python/if-elif-else-statements/index.md | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/guide/english/python/if-elif-else-statements/index.md b/guide/english/python/if-elif-else-statements/index.md index 28b3b4e31f..3b73908c49 100644 --- a/guide/english/python/if-elif-else-statements/index.md +++ b/guide/english/python/if-elif-else-statements/index.md @@ -4,8 +4,9 @@ title: If / Elif / Else Statements ## If / Elif / Else Statements -The `if`/`elif`/`else` structure is a common way to control the flow of a program, allowing you to execute specific blocks of code depending on the value of some data. If the condition following the keyword `if` evaluates as `True`, the block of code will execute. -Note: that parenthesis is not used before and after the condition check as in other programming languages. +The `if`/`elif`/`else` structure is a common way to control the flow of a program, allowing you to execute specific blocks of code depending on the value of some data. If the condition following the keyword `if` evaluates as `True`, the block of code will execute: +Note that parenthesis are not used before and after the condition check such as in other languages. + ```python if True: print('If block will execute!') @@ -62,7 +63,7 @@ else: print("Neither will I!") #this statement does not execute ``` -*Note: only the first condition that evaluates as `True` will execute. Even though `z > 6` is `True`, the `if/elif/else` block terminates after the first true condition. This means that an `else` will only execute if none of the conditions were `True`.* +*Note only the first condition that evaluates as `True` will execute. Even though `z > 6` is `True`, the `if/elif/else` block terminates after the first true condition. This means that an `else` will only execute if none of the conditions prior to it were `True`.* ***Nested if statement*** @@ -79,14 +80,14 @@ if x % 2 == 0: # this is how you create a comment and now, checking for even. else: print ("The number is not even. So no point checking further.") ``` -This was just a simple example for nested if statement. Please feel free to explore more online. +This was just a simple example of a nested if statement. Please feel free to explore more online. While the examples above are simple, you can create complex conditions using boolean comparisons and boolean operators. ***Inline python if-else statement*** -We can also use if-else statements with inline python functions +We can also use if-else statements with inline python functions. The following example should check if the number is greater or equal than 50, if yes return True: ```