January 2019
Beginner to intermediate
776 pages
19h 58m
English
Sometimes we need to check multiple conditions in a single if condition.
Let's see an example of this:

Here, we are checking the range of the marks. The flow of the program is as follows:
Assign a value of 85 to the marks variable. If marks is less than or equal to 45, print Grade C, else if marks is greater than 45 and less than equal to 75, print Grade B, else if marks is greater than 75, print Grade A, else if none of the preceding conditions match, then print Unable to determine.
The PowerShell sample code for the preceding Python task is as follows:
#PowerShell sample code:$marks=85if ($marks -le 45){ write-host ...Read now
Unlock full access