Solving Hackerrank's Python Challenges | Python if-Else | Python Soldiers

preview_player
Показать описание
Python IF, ELIF, and ELSE Statements:
While writing code in any language, you will have to control the flow of your program. This is generally the case when there is decision making involved - you will want to execute a certain line of codes if a condition is satisfied, and a different set of code incase it is not. In Python, you have the if, elif and the else statements for this purpose. In this tutorial, you will work with an example to learn about the simple if statement and gradually move on to if-else and then the if-elif-else statements. You will also learn about nesting and see an nested if example.
Рекомендации по теме