-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRunning Python.html
276 lines (256 loc) · 13.2 KB
/
Running Python.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
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="en" xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>PythonPythonME</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<meta content="Python,Programming" name="keywords" />
<meta content="Learn Python Programming" name="description" />
<meta name="generator" content="thesitewizard.com's Layout Wizard 3.0.1" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="stylesheet" type="text/css" media="all" href="styles.css" />
<style type="text/css">
.auto-style1 {
text-align: center;
}
.auto-style2 {
font-family: Georgia, "Times New Roman", Times, serif;
text-align: center;
}
.auto-style3 {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
text-align: center;
font-size: x-large;
}
.auto-style5 {
font-family: "Times New Roman", Times, serif;
}
.auto-style6 {
font-family: Georgia, "Times New Roman", Times, serif;
text-align: center;
font-size: large;
}
.auto-style4 {
font-family: "Times New Roman", Times, serif;
font-size: large;
}
.auto-style9 {
font-family: Georgia, "Times New Roman", Times, serif;
text-align: center;
font-size: xx-large;
color: #1829BB;
}
.auto-style10 {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
}
.auto-style11 {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
font-size: x-large;
}
.auto-style12 {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
text-align: center;
}
.auto-style13 {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
text-align: left;
}
.auto-style14 {
font-family: Cambria, Cochin, Georgia, Times, "Times New Roman", serif;
text-align: left;
font-size: x-large;
}
.auto-style15 {
text-align: left;
}
</style>
</head>
<body>
<div id="tswcontainer">
<div id="tswheader">
<!-- start of header section: insert your logo, etc, here -->
<p class="auto-style1">
<img alt="Logo" src="PythonPythonME.png" style="border-radius: 5px; width: 306px; height: 234px; background-color: #FFFFFF;" /></p>
<p class="auto-style3"><span lang="en-in"><strong>Running Python</strong></span></p>
<!-- end of header section: insert your logo, etc, above this line -->
</div>
<div id="tswcontent">
<div id="tswcontproper">
<!-- start of content column: insert your content here -->
<span class="auto-style5">
<p>The Python interpreter is a program that interprets Python code and
runs it. </p>
<p>You can start the interpreter by selecting on an icon or typing
python on the a command line, according on your configuration<span lang="en-in">.</span></p>
<p>When it starts, you should see output like this:</p>
<p>
<img alt="Start" src="images/Screenshot%202022-03-24%20095046.png" style="width: 951px; height: 77px" /></p>
<p>The first three lines contain details on the interpreter as well as
the operating system from which it runs, but yours may differ.</p>
<p>Nevertheless, make sure that the software version, which in this case
is 3.4.0, starts with 3, suggesting that you are using Python 3.</p>
<p>The final line is a prompt, indicating that the interpreter is
available for code entry. The interpreter shows the following result
when you write a piece of code and press Enter:</p>
<p class="auto-style1">
<img alt="Add demo" src="images/Screenshot%202022-03-24%20095401.png" style="width: 83px; height: 62px" /></p>
<p class="auto-style15">
</span>
<iframe src="https://trinket.io/embed/python3/d39510b697?start=result" width="100%" height="356" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
<p class="auto-style11"><strong>The first program</strong></p>
<p class="auto-style10"><span lang="en-in">As tradition you would write
"Hello world" as the 1st program to run on python like every other
beginner !!</span></p>
<p class="auto-style12">
<img alt="Hello world" src="images/Screenshot%202022-03-24%20095811.png" style="width: 187px; height: 46px" /></p>
<p class="auto-style13"><span lang="en-in">You can also print output
with print statement :</span></p>
<p class="auto-style12">
<img alt="print hello" src="images/Screenshot%202022-03-24%20095946.png" style="width: 267px; height: 42px" /></p>
<p class="auto-style13">On the screen, it shows the outcome. The result
in this case is the phrase "Hello, World!"<span lang="en-in">. </span>
The quotation marks in the program indicate the start and end of the
text to be displayed<span lang="en-in">. Here in the </span>final result<span lang="en-in">
the quotation marks are not visible</span>.</p>
<p class="auto-style13">
<iframe src="https://trinket.io/embed/python3/ff4b7d06b8?start=result&runMode=console" width="100%" height="356" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
<p class="auto-style14"><strong>Arithmetic operators</strong></p>
<p class="auto-style13">Operators are special symbols in Python which
depict computations such as arithmetic operations.<br />
As shown in the instances below, the operators +, -, and * operate
addition, subtraction, and multiplication.</p>
<p class="auto-style12">
<img alt="operations" src="images/Screenshot%202022-03-24%20100817.png" style="width: 127px; height: 162px" /></p>
<p class="auto-style13">Exponentiation is performed by the operator **,
which raises a number to a power:</p>
<p class="auto-style12">
<img alt="exponent" src="images/Screenshot%202022-03-24%20100939.png" style="width: 131px; height: 41px" /></p>
<p class="auto-style13">In other languages, <span lang="en-in">"</span>^<span lang="en-in">"
symbol </span>would be used for exponentiation; nevertheless, in Python,
it is a bitwise operator known as XOR.</p>
<p class="auto-style12">
<img alt="symbol demo 1" src="images/Screenshot%202022-03-24%20101148.png" style="width: 101px; height: 43px" /></p>
<p class="auto-style13">
<iframe src="https://trinket.io/embed/python3/76be919742?start=result&runMode=console" width="100%" height="356" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
</p>
<p class="auto-style14"><strong>Values and types </strong></p>
<p class="auto-style13">A <strong>value</strong>, like a letter or a
number, is one of the fundamental things that a program works with. Up
to this point, we've already seen values 2, 42.0, and 'Hello, World!'</p>
<p class="auto-style13">These values are classified as follows: </p>
<ul>
<li>
<p class="auto-style13">The number 2 is an integer<span lang="en-in">.
</span></p>
</li>
<li>
<p class="auto-style13"><span lang="en-in">T</span>he number 42.0 is
a floating-point number, as well as the phrase 'Hello, World!'<span lang="en-in">.</span></p>
</li>
<li>
<p class="auto-style13">'Hello, World!' is a string, so named since
the letters in it are stitched together.</p>
</li>
</ul>
<p class="auto-style13">If you are unsure about the type of a value, the
interpreter can tell you:</p>
<p class="auto-style12">
<img alt="type" src="images/Screenshot%202022-03-24%20102207.png" style="width: 167px; height: 120px" /></p>
<p class="auto-style13">
<iframe src="https://trinket.io/embed/python3/6ff512f9ce?start=result&runMode=console" width="100%" height="356" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
</p>
<p class="auto-style13">If you are using commas to separate groups of
digits, just like in 1,000,000. This is not a valid integer in Python,
however no error is generated.</p>
<p class="auto-style12">
<img alt="new" src="images/Screenshot%202022-03-24%20102403.png" style="width: 151px; height: 43px" /></p>
<p class="auto-style13">
<iframe src="https://trinket.io/embed/python3/906269fccf?start=result&runMode=console" width="100%" height="356" frameborder="0" marginwidth="0" marginheight="0" allowfullscreen></iframe>
</p>
<p class="auto-style13">1,000,000 is interpreted by Python as a
comma-separated series of integers.</p>
<p class="auto-style14"><strong>Formal and natural languages</strong></p>
<p class="auto-style13"><strong>Natural languages</strong> are the
languages people speak,<span lang="en-in"> they may be languages as
English,Spanish,German and so on.</span></p>
<p class="auto-style13"><strong>Formal languages</strong> are languages
designed by humans for particular reasons. </p>
<p class="auto-style13">Mathematicians, for instance, use a formal
language which is especially good at indicating relationships between
numbers and symbols. </p>
<p class="auto-style13">Chemists portray the chemical structure of the
molecule using a formal language.</p>
<p class="auto-style13"><span lang="en-in">Similarly, Programming
languages are formal languages created to express computations.</span></p>
<p class="auto-style13"><span lang="en-in">You can check a list of such
progamming languages on Wikipedia :
<a href="https://en.wikipedia.org/wiki/List_of_programming_languages">
List of programming languages</a></span></p>
<p class="auto-style13"><span lang="en-in">The structure of statements
in formal languages is governed by strict syntax rules.</span></p>
<ul>
<li>
<p class="auto-style13"><span lang="en-in">In mathematics, the
statement 3 + 3 = 6 is correct, but 3+ = 3$6 is not. </span></p>
</li>
<li>
<p class="auto-style13"><span lang="en-in">H2O is a syntactically
correct formula in chemistry, but 2Zz is not.</span></p>
</li>
</ul>
<p class="auto-style13"><span lang="en-in"><strong>Tokens</strong> are
basic language elements such as words, numbers, and chemical elements.</span></p>
<p class="auto-style13"><span lang="en-in">Among the issues with '3+ =
3$6' is that '$' is not a legal mathematical symbol.</span></p>
<p class="auto-style13"><span lang="en-in">The 2nd kind of syntax rule
governs how tokens are merged. </span></p>
<p class="auto-style13"><span lang="en-in">The equation 3 + /3 is
illegal because, despite the fact that + and / are legal tokens.</span></p>
<p class="auto-style13"><span lang="en-in">Users must figure out all the
structure of a sentence in English or a statement in a formal language
when users read it , This is known as <strong><em>parsing</em></strong>.</span></p>
<p class="auto-style14"><strong>Debugging </strong></p>
<p class="auto-style3">
<img alt="bugs" src="images/software-bug-undocumented-feature-computer-software-computer-icons-programmer-png-favpng-gGtqdfmXYZFgwXBDg0drZ5qWU.png" style="width: 272px; height: 230px" /></p>
<p class="auto-style13">Programmers make errors. For illustrative
purposes, programming errors are referred to as bugs, and the method of
hunting them down is referred to as debugging.</p>
<p class="auto-style13">Learning to debug can be frustrating, but it is
a valuable skill that is useful for many activities beyond programming.</p>
<p class="auto-style13"> </p>
</div>
</div>
<div id="tswsidecol">
<div id="tswsideproper">
<p class="auto-style9">
<strong>Content
</strong>
</p>
<p class="auto-style6">
<a href="index.html">PythonPythonME</a></p>
<p class="auto-style6"><a href="Running%20Python.html">Running Python</a></p>
<p class="auto-style6"><span lang="en-in"><a href="Variables.html">
Variables</a></span></p>
<p class="auto-style6"><span lang="en-in"><a href="Functions.html">
Functions</a></span></p>
<p class="auto-style6"><span lang="en-in"><a href="Terms_1.html">Terms</a></span></p>
<!-- end of side column: put your navigation menu, etc, above this line -->
</div>
</div>
<div style="clear: both;">
<div id="tswcontainer0">
<div style="clear: both;" class="auto-style1"><br />
<span lang="en-in">
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
<img alt="Footer " height="64" src="images/star-line-divider-design-footer-modern-border-vector-23980591.png" width="1118" /><br />
<span lang="en-in">
-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------</span><br />
</div>
</div>
<p class="auto-style2">Copyright
<span class="auto-style4" style="color: rgb(0, 0, 0); font-style: normal; font-variant-ligatures: normal; font-variant-caps: normal; font-weight: 400; letter-spacing: normal; orphans: 2; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-stroke-width: 0px; background-color: rgb(255, 255, 255); text-decoration-thickness: initial; text-decoration-style: initial; text-decoration-color: initial; display: inline !important; float: none;">
© 2022-2023. Anoop Johny. </span>All Rights Reserved.</p>
</div>
</div>
</body>
</html>