-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathlesson-2.html
157 lines (147 loc) · 6.19 KB
/
lesson-2.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
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
<!DOCTYPE html>
<html lang="en">
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<title>Py Course</title>
<meta name="generator" content="Bootply"/>
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<link href="css/bootstrap.min.css" rel="stylesheet">
<!--[if lt IE 9]>
<script src="//html5shim.googlecode.com/svn/trunk/html5.js"></script>
<![endif]-->
<link href="css/styles.css" rel="stylesheet">
</head>
<body>
<!-- header -->
<div id="top-nav" class="navbar navbar-inverse navbar-static-top">
<div class="container-fluid">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Course Outline</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav navbar-right">
<li class="dropdown">
</li>
</ul>
</div>
</div>
<!-- /container -->
</div>
<!-- /Header -->
<!-- Main -->
<div class="container-fluid">
<div class="row">
<div class="col-sm-3">
<!-- Left column -->
<hr>
<ul class="nav nav-stacked">
<ul class="nav nav-stacked collapse in" id="userMenu">
<li><a href="index.html"><h4>Lesson 1</h4></a></li>
<li class="active"><a href="lesson-2.html"><h4>Lesson 2</h4></a></li>
<!-- <li><a href="#"><i class="glyphicon glyphicon-cog"></i>Week 2</a></li>
<li><a href="#"><i class="glyphicon glyphicon-cog"></i>Week 3</a></li>
<li><a href="#"><i class="glyphicon glyphicon-cog"></i>Week 4</a></li> -->
</ul>
</li>
</ul>
</div>
<!-- /col-3 -->
<div class="col-sm-9">
<h2>Program Control Flow</h2>
<article>
<h3>What is program Control Flow</h3>
<p>Its the process of giving a program logic or intelligence by means of conditional statements</p>
<p>These conditional statements are created by coupling operators such as comparison operators,
boolean operators and logic operators <br> with statements such as if and while</p>
<h4>Examples of conditional Statements</h4>
<div>
<p>
<pre><i> if a < 12</i></pre>
</p>
<p>
<pre><i> if a > 5</i></pre>
</p>
<p>
<pre><i> while a > 5</i></pre>
</p>
</div>
<h3> Comparison Operators</h3>
<p>Assume variable a holds 10 and variable b holds 20, then −</p>
<table class="table table-bordered">
<tr>
<th style="width:10%">Operator</th>
<th style="width:45%">Description</th>
<th>Example</th>
</tr>
<tr>
<td>==</td>
<td>If the values of two operands are equal, then the condition becomes true.</td>
<td> (a == b) is not true.</td>
</tr>
<tr>
<td>!=</td>
<td>If values of two operands are not equal, then condition becomes true.</td>
</tr>
<tr>
<td><></td>
<td>If values of two operands are not equal, then condition becomes true.</td>
<td> (a <> b) is true. This is similar to != operator.</td>
</tr>
<tr>
<td>></td>
<td>If the value of left operand is greater than the value of right operand, then condition
becomes true.
</td>
<td> (a > b) is not true.</td>
</tr>
<tr>
<td><</td>
<td>If the value of left operand is less than the value of right operand, then condition becomes
true.
</td>
<td> (a < b) is true.</td>
</tr>
<tr>
<td>>=</td>
<td>If the value of left operand is greater than or equal to the value of right operand, then
condition becomes true.
</td>
<td> (a >= b) is not true.</td>
</tr>
<tr>
<td><=</td>
<td>If the value of left operand is less than or equal to the value of right operand, then
condition becomes true.
</td>
<td> (a <= b) is true.</td>
</tr>
</table>
<div>
<h3>Sample Program</h3>
<pre>
if age < 24:
print(" you are still young")
else:
print("you are old")
</pre>
</div>
</article>
</div>
<!--/col-span-9-->
</div>
</div>
<!-- /Main -->
<footer class="text-center "
"><a href="http://www.bootply.com/85850"><strong>Python 101</strong></a></footer>
<!-- script references -->
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.0.2/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="js/scripts.js"></script>
</body>
</html>