-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpython.html
303 lines (254 loc) · 11.7 KB
/
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
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
<!DOCTYPE html>
<html lang="en">
<!-- Next add HTML stylesheet in the header for adding CSS elements -->
<head>
<title>Python in Computing - NativeCS</title>
<link rel=“icon” href=”/images/favicon.ico” type=“image/x-icon”>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
body {
font-family: Arial, Helvetica, sans-serif;
overflow: scroll;
position: absolute;
overflow-x: hidden;
width: 100%;
.topnav {
overflow: hidden;
background-color: #483d8b;
display: flex;
justify-content: center;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav a {
float: left;
color: #f2f2f2;
text-align: center;
padding: 14px 16px;
text-decoration: none;
font-size: 17px;
}
.topnav a:hover {
background-color: #ddd;
color: black;
}
.topnav a.active {
background-color: #ff6600;
color: white;
}
.dropdown {
float: left;
overflow: hidden;
}
.dropdown .dropbtn {
font-size: 17px;
border: none;
outline: none;
color: white;
padding: 14px 16px;
background-color: inherit;
font-family: inherit;
margin: 0;
}
.navbar a:hover, .dropdown:hover .dropbtn {
background-color: #ff6600;
}
.dropdown-content {
display: none;
position: absolute;
background-color: #f9f9f9;
min-width: 160px;
box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
z-index: 999;
}
.dropdown-content a {
float: none;
color: black;
padding: 12px 16px;
text-decoration: none;
display: block;
text-align: left;
}
.dropdown-content a:hover {
background-color: #ddd;
}
.dropdown:hover .dropdown-content {
display: block;
}
}
.header {
padding: 150px; /* some padding */
text-align: center; /* center the text */
background-image: url("images/banner-python.jpg");
background-position:bottom;
color: white; /* white text color */
}
/* Increase the font size of the <h1> element */
.header h1 {
font-size: 40px;
}
.footer {
font-size: 12px;
position:sticky;
left: 0;
bottom: 0;
width: 100%;
background-color: black;
color: white;
text-align: center;
left: 0;
bottom: 0;
overflow: hidden;
opacity: 0.9;
}
a:link {
color: inherit;
background-color: transparent;
text-decoration: none;
}
a:hover {
color: yellow;
background-color: transparent;
font-weight: bold;
}
a:visited {
color: white;
}
div.page-content {
width: 100%;
max-width: 95%;
flex-wrap: wrap;
justify-content: center;
margin-left: auto;
margin-right: auto;
padding-top: 30px;
}
div.page-content-1 {
width: 100%;
max-width: 95%;
flex-wrap: wrap;
justify-content: center;
margin-left: auto;
margin-right: auto;
padding-top: 30px;
}
.image {
display: block;
margin-left: auto;
margin-right: 30px;
margin-top: auto;
}
div.page-content-2 {
width: 100%;
max-width: 95%;
flex-wrap: wrap;
justify-content: center;
margin-left: auto;
margin-right: auto;
padding-top: 30px;
}
</style>
</head>
<!-- Stylesheet should be included in the header section -->
<body>
<div class="header">
</div>
<div class="topnav">
<a href="index.html">Home</a>
<a href="about.html">About</a>
<div class ="dropdown">
<button class="dropbtn">KS3</button>
<div class="dropdown-content">
<a href="y7.html">Year 7</a>
<a href="y8.html">Year 8</a>
<a href="y9.html">Year 9</a>
</div>
</div>
<div class ="dropdown">
<button class="dropbtn">GCSE</button>
<div class="dropdown-content">
<a href="y10.html">Year 10</a>
<a href="y11.html">Year 11</a>
</div>
</div>
<div class ="dropdown">
<button class="dropbtn">Programming</button>
<div class="dropdown-content">
<a href="python.html">Python</a>
<a href="html.html">HTML</a>
<a href="css.html">CSS</a>
<a href="js.html">JavaScript</a>
</div>
</div>
<a href="ai.html">AI</a>
<a href="resources.html">Resources</a>
</div>
<div class ="page-content">
<center><h2>Python in KS3</h2></center>
<p><img src="images/python-float.jpeg" width="300px" height="300px" style="float:left" padding-right="30" class="image">
<p>Learning Python is an integral part of the computing curriculum at secondary schools, the journey begins in year 7 and continues till year 13, students are taught how to code in increasing complexity as the academic years progress, which starts with:</h3></strong>
<p>For starters, students are introduced to commenting lines of code using the # symbol and are taught why this is essential. Additionally, simple print function for outputing text is taught</p>
<p>This is then followed by printing new lines using the <code>\n</code> function, for example <code>print("Hello\nHow are you?\nFine!")</code></p>
<strong><h3>Data Types</h3></strong>
<p>Students are taught various data types such as integer, string, boolean, real, and float. They are taught how to use them within the Python program</p>
<strong><h3>Inputs</h3></strong>
<p>To make Python interactive, students are then taught how to implement the input function using string data type, such as <code>ask = input("What is your name?: ")</code>, once this concept is grasped, then they are tasked to create an interactive chatbot progam</p>
<strong><h3>Arithmetic and Logical Operators</h3></strong>
<p>Here, students are taught about simple arithmetic operations using the BIDMAS rule, along with Python specific symbols. Additionally, coparison operators such as <code><, <=,></code> are also taught</p>
<strong><h3>Selection</h3></strong>
<p>As a computer programmer, there are situations where you need your program to execute specific lines of code only when certain conditions are met. For instance, in a login system, you may want to display an error message if the user enters an incorrect password. Conversely, if the password is correct, a different sequence of code should run to grant access to the system. In such cases, you use a programming construct called selection. This is done using IF statements, and students are taught how to program using this.</p>
<strong><h3>Graphical programming</h3></strong>
<p>As an optional taught module, students are taught how to create simple graphical programing using either: TKinter or Turtle, by implementing basic shape and animation commands using loops, which is further explored in KS4.</p>
<br></br>
<center><h2>Python in KS4 GCSE</h2></center>
<p>Everything from KS3 and including below:</p>
<strong><h3>Sequence</h3></strong>
<p>A sequence is formed when a series of program instructions are written consecutively. The code is executed one statement at a time, following the order in which the statements are written.</p>
<strong><h3>Iteration</h3></strong>
<p>To get a computer to perform repetitive tasks without writing the same code multiple times, you can use iteration. Iteration involves executing a set of instructions repeatedly by using a loop statement, which helps to reduce the program's length. In your program, you can designate a group of statements to be repeated either a specific number of times or based on a condition. There are two main types of loops:</p>
<p>Condition-controlled iteration, also known as indefinite iteration, repeats a set of instructions as long as a condition is True or until it becomes False. Examples include while loops, do while loops, and repeat until loops. Count-controlled iteration, also known as definite iteration, repeats a set number of times. Examples include for loops and for each loops.</p>
<code>for number in range(1,6):
print(number) <br>
# This is how the output looks:<br>
# 1<br>
# 2<br>
# 3<br>
# 4<br>
# 5<br>
</code>
<strong><h3>Random Number Generation</h3></strong>
<p>Random numbers have various applications in programs. For instance, they can determine the direction an enemy character takes in a game or set the x and y coordinates for the starting point of a curve. Additionally, random numbers can be used to select elements from a list, which is useful for creating a chatbot or a joke-generating program.</p>
<code>number = RANDOM_INT(1, 3)<br>
1<br>
2<br>
3<br>
</code>
<strong><h3>String Handling</h3></strong>
<p>A string is a series of characters, which can include letters, numbers, spaces, or other symbols. String handling techniques are employed to verify and modify string data. For instance, they can be used to check if a password meets length requirements or to remove or replace characters within a text.</p>
<strong><h3>Subroutines</h3></strong>
<p>A subroutine is a named segment of code that can be invoked by referencing its name in a program statement. Subroutines can be called procedures or functions. A procedure consists of a set of instructions that are executed when the procedure is called. A function also includes a set of instructions that execute upon being called, and additionally returns a value after completion.</p>
<p>Using subroutines enhances code readability and reusability by dividing the program into smaller, manageable sections. Most programming languages come with a standard library of built-in subroutines for common tasks and also provide the capability for programmers to write their own custom subroutines.</p>
<strong><h3>File handling</h3></strong>
<p>In Python, basic file handling functions enable students to interact with files, facilitating tasks like reading from and writing to files. Students are expected to learn how to open files, read data from them, write data to them, and close files properly to avoid data loss or corruption. Additionally, they may learn about file modes (such as read, write, and append modes), error handling when dealing with files, and best practices for file manipulation to develop a foundational understanding of file management in programming.</p>
</div>
</body>
<div class ="footer">
<p>© 2024-5 | Joshua Levy | <a href="https://nativecs.uk" target="_blank">Native CS UK</a> | <a href="https://github.com/nativeCS" target="_blank">GitHub</a> | <a href="https://replit.com/@nativecomputinguk" target="_blank">Replit</a> | <a href="https://www.credly.com/users/joshualevy23/badges" target="_blank">Teach Computing<a> | <a href="https://dev.to/joshualevy84/" target="_blank">.DEV</a> | <a href="https://app.datacamp.com/profile/joshualevy84" target="_blank">Datacamp</a> | <a href="https://nativenglish.uk" target="_blank">Native English UK</a></p>
<a href="https://www.w3.org/WAI/WCAG2A-Conformance"
title="Explanation of WCAG 2 Level A Conformance">
<img height="32" width="88"
src="https://www.w3.org/WAI/WCAG22/wcag2.2A"
alt="Level A conformance,
W3C WAI Web Content Accessibility Guidelines 2.2">
<a href="http://www.w3.org/html/logo/">
<img src="https://www.w3.org/html/logo/badge/html5-badge-h-css3-graphics-semantics.png" width="100" height="32" alt="HTML5 Powered with CSS3 / Styling, Graphics, 3D & Effects, and Semantics" title="HTML5 Powered with CSS3 / Styling, Graphics, 3D & Effects, and Semantics"> <p xmlns:cc="http://creativecommons.org/ns#" >This work is licensed under <a href="https://creativecommons.org/licenses/by-nc-sa/4.0/?ref=chooser-v1" target="_blank" rel="license noopener noreferrer" style="display:inline-block;">CC BY-NC-SA 4.0<img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/cc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/by.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/nc.svg?ref=chooser-v1" alt=""><img style="height:22px!important;margin-left:3px;vertical-align:text-bottom;" src="https://mirrors.creativecommons.org/presskit/icons/sa.svg?ref=chooser-v1" alt=""></a></p>
</a>
</div>
</html>