-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconditional_statements.html
121 lines (111 loc) · 4.76 KB
/
conditional_statements.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Conditional Statements</title>
<link rel="stylesheet.css" href="stylesheet.css" />
</head>
<body bgcolor="FCA500">
<!--Header-->
<header>
<div class="container">
<div class="header-left">
<img class="logo"
src="https://prog-8.com/images/html/advanced/main_logo.png" />
</div>
<div class="header-right" align="center">
<h1> Conditional Statements in Python</h1>
</div>
<span class="fa fa-bars menu-icon"></span>
</div>
</header>
<!--Top-->
<div class="top-wrapper">
<div class="container">
<h1><i>Conditional Statements</i></h1>
<h3>A conditional statement may refer to:</h3>
<p>
<ul style="list-style-type:square;">
<li> In logic and mathematics:</li>
<ul>
<li>
Material conditional, a propositional binary connective
</li>
<li>
Strict conditional, a formal way of expressing the meaning of a conditional sentence
</li>
</ul>
<li> A conditional sentence in natural language, including:</li>
<ul>
<li> Indicative conditional</li>
<li> Counterfactual conditional</li>
</ul>
<li>Conditional (computer programming), a conditional statement in a computer programming language</li>
</ul>
</p>
</div>
</div>
<!--Lesson-->
<div class="lesson-wrapper">
<div class="container">
<div class="heading">
<h2><i> Syntax of If condition is:- </i></h2>
</div>
<p>
In <b>If condition</b> will be checked if it condition is true then print statement inside if will print. else there will be no output.
</p>
<p>
if condition:
</p>
<p>
print statement;
</p>
<div class="heading">
<h2><i> Syntax of If-Else condition is:- </i></h2>
</div>
<p>
In <b>If-Else condition</b>condition with <b>IF</b> will be checked if condition is true then print statement inside <b>IF</b> will print
<b>ELSE</b> print statement inside else will print.
</p>
<p>if condition: </p>
<p>print statement;</p>
<p>else:</p>
<p>print statement;</p>
<div class="heading">
<h2><i> Syntax of Else-If condition is:- </i></h2>
</div>
<p>
In <b>Else-If condition</b> condition with <b>IF</b> will be checked if condition is true then print statement inside <b>IF</b> will print
if it is false then condition with <b>ELSE</b> will be checked if it also is false then print statement inside <b>ELSE</b> will print.
</p>
<p>if condition: </p>
<p>print statement;</p>
<p>elif condition</p>
<p>print statement;</p>
<p>else:</p>
<p>print statement;</p>
<div class="heading">
<h2><i> Syntax of Nested-If condition is:- </i></h2>
</div>
<p>
In <b>Nested-If condition</b>condition with <b>IF</b> will be checked if condition is true then condition with <b>IF</b> which is inside <b>IF</b> will checked
will check.if this is also true then print statement of both <b>IF</b> will display as output.
</p>
<p>if condition: </p>
<p>if condition:</p>
<p>print statement;</p>
<p>print statement;</p>
<div align="center">
<h3><b><i> Watch this video to clear the doubts.</i></b></h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/kROgBjKcvE0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
</div>
</div>
</div>
<footer>
<div class="container">
<img src="https://prog-8.com/images/html/advanced/footer_logo.png" />
<p>Learn to code, learn to be creative.</p>
</div>
</footer>
</body>
</html>