Skip to content

Commit 7b59816

Browse files
committed
Updates to claat tool
1 parent 57be640 commit 7b59816

File tree

15 files changed

+1541
-1518
lines changed

15 files changed

+1541
-1518
lines changed

site/.publish

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Subproject commit 0793945e7a52486bf288d8e4b1c7995c49461119
1+
Subproject commit 277241d38ba1f288b164cdd0fea19b0ae4c7a6a9

site/codelabs/faqs/index.html

Lines changed: 28 additions & 28 deletions
Large diffs are not rendered by default.

site/codelabs/getting-started/index.html

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<title>Getting Started</title>
1010
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400|Roboto:400,300,400italic,500,700|Roboto+Mono">
1111
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
12-
<link rel="stylesheet" href="https://storage.googleapis.com/codelab-elements/codelab-elements.css">
12+
<link rel="stylesheet" href="https://storage.googleapis.com/claat-public/codelab-elements.css">
1313
<style>
1414
.success {
1515
color: #1e8e3e;
@@ -29,7 +29,7 @@
2929

3030
<google-codelab-step label="Using these notes" duration="20">
3131
<h2 class="checklist" is-upgraded>What you&#39;ll learn</h2>
32-
<ul>
32+
<ul class="checklist">
3333
<li>An introduction to Python, and how to get started with this course.</li>
3434
</ul>
3535
<p>Modern programming is practically always done in an IDE (integrated development environment). An IDE contains a set of useful tools for the programmer. It does not create the program by itself, but it can give hints about common mistakes in the code, and help the programmer understand the structure of the program.</p>
@@ -57,32 +57,30 @@ <h2 is-upgraded>Programmers Write Source Code</h2>
5757
<pre><code language="language-python" class="language-python">print(&#34;Hello World&#34;)
5858
</code></pre>
5959
<p>The above statement is pre-built into Python, and it&#39;s used for printing a string. The statement tells the computer to output the string that&#39;s been provided to it, placed between the quotation marks.</p>
60-
<p>A lot of the programs you&#39;ll see in this course will have a certain frame around the code; the <code>def main():</code> syntax and the <code>if __name__ == &#39;__main__&#39;:</code> block. Don&#39;t worry too much about this for now, it&#39;ll become very familiar over the course of the material. You don&#39;t technically need the framing around the <code>print</code> statement or the <code>if __name__ == &#39;__main__&#39;:</code> block for the program to be able to run in Python, but it&#39;s useful to get into the habit now to make things easier later.</p>
60+
<p>A lot of the programs you&#39;ll see in this course will have a certain frame around the code; the <code>def main():</code> syntax and the <code>if __name__ == '__main__':</code> block. Don&#39;t worry too much about this for now, it&#39;ll become very familiar over the course of the material. You don&#39;t technically need the framing around the <code>print</code> statement or the <code>if __name__ == '__main__':</code> block for the program to be able to run in Python, but it&#39;s useful to get into the habit now to make things easier later.</p>
6161
<pre><code language="language-python" class="language-python">def main():
6262
print(&#34;Welcome to the course - you will learn to program!&#34;)
6363

6464
if __name__ == &#39;__main__&#39;:
6565
main()
6666
</code></pre>
67-
<aside class="warning"><p><strong>Note:</strong> It is important to realise at this stage that <em>indentation</em> is critical in Python which is slightly different to other languages. The code snippet below is not the same as the one above and would result in an error.</p>
68-
</aside>
67+
<p>Negative : <strong>Note:</strong> It is important to realise at this stage that <em>indentation</em> is critical in Python which is slightly different to other languages. The code snippet below is not the same as the one above and would result in an error.</p>
6968
<pre><code language="language-python" class="language-python">def main():
7069
print(&#34;Welcome to the course - you will learn to program!&#34;) #this indentation is wrong
7170
if __name__ == &#39;__main__&#39;:
7271
main()
7372
</code></pre>
74-
<aside class="special"><p><strong>Note:</strong> If you don&#39;t want or need to set up a local development environment at this stage, and you are happy working in Repl.it, you can safely <a href="https://scott3142.uk/python-programming/codelabs/part-1/index.html?index=..%2F..index#0" target="_blank">skip ahead</a> to Part 1 of the notes. <br><br> If you are just starting out with Python and you&#39;re not planning to do any serious software development yet, this is probably the recommended course of action. <br><br> If you&#39;d like to set up Python on your computer, gain an understanding of the command line and Git, carry on to the <a href="https://scott3142.uk/python-programming/codelabs/local-development-environment/index.html?index=..%2F..index#0" target="_blank">next section</a>.</p>
75-
</aside>
73+
<p>Positive : <strong>Note:</strong> If you don&#39;t want or need to set up a local development environment at this stage, and you are happy working in Repl.it, you can safely <a href="https://scott3142.uk/python-programming/codelabs/part-1/index.html?index=..%2F..index#0" target="_blank">skip ahead</a> to Part 1 of the notes. <br><br> If you are just starting out with Python and you&#39;re not planning to do any serious software development yet, this is probably the recommended course of action. <br><br> If you&#39;d like to set up Python on your computer, gain an understanding of the command line and Git, carry on to the <a href="https://scott3142.uk/python-programming/codelabs/local-development-environment/index.html?index=..%2F..index#0" target="_blank">next section</a>.</p>
7674

7775

7876
</google-codelab-step>
7977

8078
</google-codelab>
8179

82-
<script src="https://storage.googleapis.com/codelab-elements/native-shim.js"></script>
83-
<script src="https://storage.googleapis.com/codelab-elements/custom-elements.min.js"></script>
84-
<script src="https://storage.googleapis.com/codelab-elements/prettify.js"></script>
85-
<script src="../../elements/codelab-elements/codelab-elements.js"></script>
80+
<script src="https://storage.googleapis.com/claat-public/native-shim.js"></script>
81+
<script src="https://storage.googleapis.com/claat-public/custom-elements.min.js"></script>
82+
<script src="https://storage.googleapis.com/claat-public/prettify.js"></script>
83+
<script src="https://storage.googleapis.com/claat-public/codelab-elements.js"></script>
8684
<script src="//support.google.com/inapp/api.js"></script>
8785

8886
</body>

site/codelabs/guess-the-number/index.html

Lines changed: 13 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
<title>Guess the number</title>
1010
<link rel="stylesheet" href="//fonts.googleapis.com/css?family=Source+Code+Pro:400|Roboto:400,300,400italic,500,700|Roboto+Mono">
1111
<link rel="stylesheet" href="//fonts.googleapis.com/icon?family=Material+Icons">
12-
<link rel="stylesheet" href="https://storage.googleapis.com/codelab-elements/codelab-elements.css">
12+
<link rel="stylesheet" href="https://storage.googleapis.com/claat-public/codelab-elements.css">
1313
<style>
1414
.success {
1515
color: #1e8e3e;
@@ -29,7 +29,7 @@
2929

3030
<google-codelab-step label="Guessing the computer&#39;s answer" duration="30">
3131
<h2 class="checklist" is-upgraded>What you&#39;ll learn</h2>
32-
<ul>
32+
<ul class="checklist">
3333
<li>Create a simple guessing game in Python.</li>
3434
<li>Get to grips with taking user input, loops and if statements.</li>
3535
</ul>
@@ -66,15 +66,14 @@ <h2 is-upgraded>Improving the program</h2>
6666
computer says lower
6767
</code></pre>
6868
<p>In the next exercise you will implement this program yourself in Python.</p>
69-
<aside class="special"><p><strong>Exercise - Guess the number <br><br></strong> Read the instructions for the exercise and commit the solution via Github. <br><br> <a href="https://classroom.github.com/a/_rKYt4oC" target="_blank">Accept exercise on Github Classroom</a></p>
70-
</aside>
69+
<p>Positive : <strong>Exercise - Guess the number <br><br></strong> Read the instructions for the exercise and commit the solution via Github. <br><br> <a href="https://classroom.github.com/a/_rKYt4oC" target="_blank">Accept exercise on Github Classroom</a></p>
7170

7271

7372
</google-codelab-step>
7473

7574
<google-codelab-step label="Computer guesses user&#39;s answer" duration="30">
7675
<h2 class="checklist" is-upgraded>What you&#39;ll learn</h2>
77-
<ul>
76+
<ul class="checklist">
7877
<li>Create a simple guessing game in Python.</li>
7978
<li>Develop algorithmic thinking and optimisation skills.</li>
8079
</ul>
@@ -101,17 +100,15 @@ <h2 class="checklist" is-upgraded>What you&#39;ll learn</h2>
101100
</ul>
102101
<p>In the following exercise, you will implement this program in Python. Can you fix the two points described above?</p>
103102
<p><em>Hint: You may want to use a list to store the guesses.</em></p>
104-
<aside class="special"><p>As a human, we might work out that there are some tricks to this game that make winning much easier. For example, if our first guess is exactly halfway between the two endpoints, we have the best chance of getting it right in the least number of moves possible. Can you implement this functionality? <br><br> Can you program the functionality that tracks how many guesses the computer took to get the right answer and see if it beats a user on average?</p>
105-
</aside>
106-
<aside class="special"><p><strong>Exercise - Computer guess the number <br><br></strong> Read the instructions for the exercise and commit the solution via Github. <br><br> <a href="https://classroom.github.com/a/DBA_EnCh" target="_blank">Accept exercise on Github Classroom</a></p>
107-
</aside>
103+
<p>Positive : As a human, we might work out that there are some tricks to this game that make winning much easier. For example, if our first guess is exactly halfway between the two endpoints, we have the best chance of getting it right in the least number of moves possible. Can you implement this functionality? <br><br> Can you program the functionality that tracks how many guesses the computer took to get the right answer and see if it beats a user on average?</p>
104+
<p>Positive : <strong>Exercise - Computer guess the number <br><br></strong> Read the instructions for the exercise and commit the solution via Github. <br><br> <a href="https://classroom.github.com/a/DBA_EnCh" target="_blank">Accept exercise on Github Classroom</a></p>
108105

109106

110107
</google-codelab-step>
111108

112109
<google-codelab-step label="Wrapping it all up in a web app" duration="30">
113110
<h2 class="checklist" is-upgraded>What you&#39;ll learn</h2>
114-
<ul>
111+
<ul class="checklist">
115112
<li>Getting started with web apps in Python.</li>
116113
<li>How to dynamically update a web app given user input.</li>
117114
</ul>
@@ -129,27 +126,25 @@ <h2 is-upgraded>Getting started with Flask</h2>
129126
app.run()
130127
</code></pre>
131128
<p>This code outputs &#34;Hello, World!&#34; in a web browser on your computer&#39;s localhost port 5000 (i.e. at <a href="http://localhost:5000" target="_blank">http://localhost:5000</a>) when run with the <code>python3 app.py</code> command and the Flask library installed.</p>
132-
<aside class="special"><p>In order to do this on your own machine, you&#39;ll have to: <br><br> - <a href="https://scott3142.uk/python-programming/codelabs/getting-started/index.html" target="_blank">Have Python installed</a> <br> - <a href="https://scott3142.uk/python-programming/codelabs/getting-started/index.html?index=..%2F..index#3" target="_blank">Activate a virtual environment</a> <br> - <a href="https://scott3142.uk/python-programming/codelabs/getting-started/index.html?index=..%2F..index#2" target="_blank">Install Flask inside your virtual environment using pip</a></p>
133-
</aside>
129+
<p>Positive : In order to do this on your own machine, you&#39;ll have to: <br><br> - <a href="https://scott3142.uk/python-programming/codelabs/getting-started/index.html" target="_blank">Have Python installed</a> <br> - <a href="https://scott3142.uk/python-programming/codelabs/getting-started/index.html?index=..%2F..index#3" target="_blank">Activate a virtual environment</a> <br> - <a href="https://scott3142.uk/python-programming/codelabs/getting-started/index.html?index=..%2F..index#2" target="_blank">Install Flask inside your virtual environment using pip</a></p>
134130
<p>You can set up a virtual environment and install <code>flask</code> using the following commands in a terminal:</p>
135131
<pre><code language="language-plaintext" class="language-plaintext">user@host:~$ virtualenv flask_env
136132
user@host:~$ source flask_env/bin/activate
137133
user@host:~$ pip install flask
138134
user@host:~$ python3 app.py
139135
</code></pre>
140136
<p>Once you have done that, clone the exercise repo below and follow the instructions in the README.</p>
141-
<aside class="special"><p><strong>Exercise - Guessing the number in a web app <br><br></strong> Read the instructions for the exercise and commit the solution via Github. <br><br> <a href="https://classroom.github.com/a/ku4AAUEN" target="_blank">Accept exercise on Github Classroom</a></p>
142-
</aside>
137+
<p>Positive : <strong>Exercise - Guessing the number in a web app <br><br></strong> Read the instructions for the exercise and commit the solution via Github. <br><br> <a href="https://classroom.github.com/a/ku4AAUEN" target="_blank">Accept exercise on Github Classroom</a></p>
143138

144139

145140
</google-codelab-step>
146141

147142
</google-codelab>
148143

149-
<script src="https://storage.googleapis.com/codelab-elements/native-shim.js"></script>
150-
<script src="https://storage.googleapis.com/codelab-elements/custom-elements.min.js"></script>
151-
<script src="https://storage.googleapis.com/codelab-elements/prettify.js"></script>
152-
<script src="../../elements/codelab-elements/codelab-elements.js"></script>
144+
<script src="https://storage.googleapis.com/claat-public/native-shim.js"></script>
145+
<script src="https://storage.googleapis.com/claat-public/custom-elements.min.js"></script>
146+
<script src="https://storage.googleapis.com/claat-public/prettify.js"></script>
147+
<script src="https://storage.googleapis.com/claat-public/codelab-elements.js"></script>
153148
<script src="//support.google.com/inapp/api.js"></script>
154149

155150
</body>

0 commit comments

Comments
 (0)