Python in Education by Nicholas H. Tollervey
Author:Nicholas H. Tollervey
Language: eng
Format: mobi, epub, pdf
Publisher: O'Reilly Media, Inc.
Published: 2015-03-16T04:00:00+00:00
Chapter 3. Why Python in Education?
I am going to answer a very simple question: which features of the Python language itself make it appropriate for education? This will involve learning a little Python and reading some code. But don’t worry if you’re not a coder! This chapter will hopefully open your eyes to how easy it is to learn Python (and thus, why it is such a popular choice as a teaching language).
Code Readability
When I write a to-do list on a piece of paper, it looks something like this:
Shopping Fix broken gutter Mow the lawn
This is an obvious list of items. If I wanted to break down my to-do list a bit further, I might write something like this:
Shopping: Eggs Bacon Tomatoes Fix broken gutter: Borrow ladder from next door Find hammer and nails Return ladder! Mow the lawn: Check lawn around pond for frogs Check mower fuel level
Intuitively we understand that the main tasks are broken down into sub-tasks that are indented underneath the main task to which they relate. This makes it easy to see, at a glance, how the tasks relate to each other.
This is called scoping.
Indenting in this manner is also how Python organizes the various tasks defined in Python programs. For example, the following code simply says that there is a function called say_hello that asks the user to input their name, and then — you guessed it — prints a friendly greeting:
def say_hello(): name = input('What is your name? ') print('Hello, ' + name)
Here’s this code in action (including my user input):
What is your name? Nicholas Hello, Nicholas
Notice how the lines of code implementing the say_hello function are indented just like the to-do list. Furthermore, each instruction in the code is on its own line. The code is easy to read and understand: it is obvious which lines of code relate to each other just by looking at the way the code is indented.
Most other computer languages use syntactic symbols rather than indentation to indicate scope. For example, many languages such as Java, JavaScript and C use curly braces and semicolons for this purpose.
Why is this important?
If, like me, you have taught students with English as an additional language or who have a special educational need such as dyslexia, then you will realize that Python’s intuitive indentation is something people the world over understand (no matter their linguistic background). A lack of confusing symbols such as '{', '}' and ';' scattered around the code also make it a lot easier to read Python code. Such indentation rules also guide how the code should look when you write it down — the students intuitively understand how to present their work.
Compared to most other languages, Python’s syntax (how it is written) is simple and easy to understand. For example, the following code written using the Perl programming language will look for duplicate words in a text document:
print "$.: doubled $_\n" while /\b(\w+)\b\s+\b\1\b/gi
Can you work out how Perl does this?
(In Perl’s defense, it is an amazingly powerful programming language with a different set of aims and objectives than Python.
Download
Python in Education by Nicholas H. Tollervey.epub
Python in Education by Nicholas H. Tollervey.pdf
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.
What's Done in Darkness by Kayla Perrin(26522)
Shot Through the Heart: DI Grace Fisher 2 by Isabelle Grey(19007)
The Fifty Shades Trilogy & Grey by E L James(18961)
Shot Through the Heart by Mercy Celeste(18880)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 10 by Isuna Hasekura and Jyuu Ayakura(16985)
Python GUI Applications using PyQt5 : The hands-on guide to build apps with Python by Verdugo Leire(16875)
Peren F. Statistics for Business and Economics...Essential Formulas 3ed 2025 by Unknown(16805)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 03 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16699)
Wolf & Parchment: New Theory Spice & Wolf, Vol. 01 by Isuna Hasekura and Jyuu Ayakura & Jyuu Ayakura(16326)
The Subtle Art of Not Giving a F*ck by Mark Manson(14262)
The 3rd Cycle of the Betrayed Series Collection: Extremely Controversial Historical Thrillers (Betrayed Series Boxed set) by McCray Carolyn(14072)
Stepbrother Stories 2 - 21 Taboo Story Collection (Brother Sister Stepbrother Stepsister Taboo Pseudo Incest Family Virgin Creampie Pregnant Forced Pregnancy Breeding) by Roxi Harding(13421)
Scorched Earth by Nick Kyme(12716)
Drei Generationen auf dem Jakobsweg by Stein Pia(10922)
Suna by Ziefle Pia(10846)
Scythe by Neal Shusterman(10271)
International Relations from the Global South; Worlds of Difference; First Edition by Arlene B. Tickner & Karen Smith(9476)
Successful Proposal Strategies for Small Businesses: Using Knowledge Management ot Win Govenment, Private Sector, and International Contracts 3rd Edition by Robert Frey(9316)
This is Going to Hurt by Adam Kay(9098)
