-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathloops.html
93 lines (84 loc) · 3.91 KB
/
loops.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
<html>
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Loops</title>
<link rel="stylesheet.css" href="stylesheet.css" />
</head>
<body bgcolor=" #FF69B4">
<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> Loops in Python</h1>
</div>
<span class="fa fa-bars menu-icon"></span>
</div>
</header>
<!-- Top -->
<div class="top-wrapper">
<div class="container">
<h1><i>Control Flow</i></h1>
<h4>
In computer science, control flow (or flow of control) is the order in which individual statements, instructions or function calls of an imperative program are executed or evaluated. The emphasis on explicit control flow distinguishes an imperative programming language from a declarative programming language.
</h4>
<h3><i> There are two primitive loop commands which are as follows:- </i></h3>
<ul>
<li>For Loop</li>
<li>While Loop</li>
</ul>
</div>
</div>
<!-- Lesson -->
<div class="lesson-wrapper">
<div class="container">
<div class="heading">
<h2><i> Python For Loop </i></h2>
<h4>A for loop is used for iterating over a sequence (that is either a list, a tuple, a dictionary, a set, or a string).</h4>
</div>
<h4>
This is less like the for keyword in other programming languages, and works more like an iterator method as found in other object-orientated programming languages.
</h4>
<h4>
With the for loop we can execute a set of statements, once for each item in a list, tuple, set etc.
</h4>
<div class="heading">
<h3><i>Syntax of For Loop:-</i></h3>
</div>
<p>fruits=["apple", "banana", "cherry"]</p>
<p>for x in fruits:</p>
<p>print(x)</p>
<p><b>Note:- </b>Here 'x' is variable which is decleared in for loop.</p>
<h3 align="center"><b><i> Watch this video to clear your doubts.</i></b></h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/VtvVejRtwt0" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen align="middle"></iframe>
<div class="heading">
<h2><i>Python While Loop </i></h2>
<h4>With the while loop we can execute a set of statements as long as a condition is true.</h4>
</div>
<div class="heading">
<h3><i>Syntax of While Loops is :-</i></h3>
</div>
<div>
<p> variable declaration</p>
<p>while (condition)</p>
<p>print statement</p>
<p>increment or decrement</p>
</div>
<div align="center">
<h3><b><i> Watch this video to clear your doubts.</i></b></h3>
<iframe width="560" height="315" src="https://www.youtube.com/embed/wjz4DWwANhE" frameborder="0" allow="accelerometer; autoplay; encrypted-media; gyroscope; picture-in-picture" allowfullscreen align="middle"></iframe>
</div>
</div>
</div>
<!--Footer-->
<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>