RPA | Python Statements| Jupyter Notebook - Part-47
Python Statements - In this blog we will discuss about the various statements such as if, elif, else and also for loop and while loops in python using Jupyter Notebook. So let us look into each of the statements in detail one by one.
- If Statement - The if statement one of the type of decision making statement which will be used to decide whether a certain set of statements or block of statements would be executed or not. If a certain condition is true then the block of statements under the if block will be executed otherwise these statements won't be executed if the condition is false. So let us look at the syntax of if statement which is as follows:
When we are using if statement then the indentation matters the most as and when the indentation gets wrong the execution of the code will result in an error.
- if else statement - The if else statement is used to determine whether an if block will be executed if the if condition is true otherwise the else block of code would be executed if the condition is false. So the syntax for if else statement would look something like this using Python which is as follows:
- if-elif-else statement - The if-elif-else statement will determine which block of code needs to be executed depending upon the condition so the syntax would for if-elif-else statement would look something like this which is as follows:-
- Nested If Statement - The Nested if statement contains an if within an if statement which will check which block of code needs to be executed depending upon which if condition results to true. So let us take a look at the syntax of nested if statement which is as shown below:
If you have any queries related to this article or blog then you can raise your queries in the comment section and I will be more than happy to answer all of your queries.
Lastly I would request all of you to please provide your feedback as the feedback that you provide really matters the most to me.
The content of this blog is essential to learning stage people. Thanks for sharing.
ReplyDeleteRPA Training in Chennai
RPA Training Online
RPA Training In Bangalore
RPA Automation Tools