Files
Lee Hanken 7c8efd2228 Initial commit: HPR Knowledge Base MCP Server
- MCP server with stdio transport for local use
- Search episodes, transcripts, hosts, and series
- 4,511 episodes with metadata and transcripts
- Data loader with in-memory JSON storage

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-26 10:54:13 +00:00

178 lines
17 KiB
Plaintext

Episode: 295
Title: HPR0295: Illustrious Programmer E1: Vocab and Basics
Source: https://hub.hackerpublicradio.org/ccdn.php?filename=/eps/hpr0295/hpr0295.mp3
Transcribed: 2025-10-07 15:44:24
---
I'll see you later.
Hello and welcome to the illustrious programmer, a learning how to program podcast brought to
you by Hacker Public Radio.
This is the Alchemantist and I will be your host for the illustrious programmer.
Hello and welcome to episode one of the illustrious programmer.
In today's episode, we're going to review homework from episode zero, take kind of an
eagle's eye view of language in general, look at Python, Python in interactive mode,
Python in scripting mode, important vocabulary, and debugging tip number one, debugging tips
that are going to be things that I try to do from time to time to help you debug your code.
Okay, first off the homework, you should now have a working copy of Python installed on your system,
and you should also have a copy of the learning python.pdf book.
We're going to follow that book very, very closely.
A lot of what I talk about is going to be mirrored in that book, so I hope you are reading along
in an effort to be able to read and hear.
I'm following along the book because a lot of times people have different ways of learning.
You can hear it and learn it one way and read it and learn another thing and maybe do it and learn something out.
So you can never really get too much of too many different ways of learning something,
which kind of leads us into the first topic after our homework, which is languages, so it's kind of leading for languages.
There are two kinds of languages that we're going to talk about, natural language and the formal language.
A natural language is something like English or French, German, Italian, all of those are natural languages,
languages that you learn to speak naturally.
Now, lots of these natural languages have different ways of saying things, so poetry and prose and political speeches and laws and things like that can be very, very different from each other.
And it can also be very, very difficult to extract the meaning.
People try very, very hard to make themselves easily understood, but that doesn't always happen.
As you can see by maybe various teachers that you've had various courses you've taken, sometimes people try very, very hard to make what they're saying difficult to understand in the case of politicians when they're writing laws and stuff.
You might remember the very famous political line, Bill Clinton says, well, it all depends on what the definition of is is.
Are there nuclear weapons in blah, blah, blah? Well, kind of.
He took that nuance of language and played with it a little bit.
He really played with it a lot.
And formal languages are different in that there's one meaning.
So a formal language, an example of that is like the language of a math. Some would say that the language of music.
The exact meaning is built into the language. So the expression x equals four in a mathematical setting always means that x equals four.
It's never going to mean that, oh well, this time x equals four means 37.
So it's not going to, it's not going to trick you there.
Programming languages are also formal languages. Computers are operate on this formal language level.
If you tell a program to do something, it'll do exactly what you tell it.
Nothing more, nothing less. And this is where errors come in because sometimes we want a computer to do something but we don't tell it to do that.
We tell it to do something else and then we call that a computer error.
And programming languages leads us into Python. Python is kind of a, what they call a high level programming language and you can read more about this in the text.
It doesn't really matter that Python is a high level programming language just that you understand.
Python speaks closer to a natural language than it does to a computer language.
And the computer language is mostly, you know, it understands ones and zeros and odds and offs and things like that.
Whereas Python is in a more of a vernacular kind of thing.
Now there are other languages that accomplish similar things.
C++, PHP, Fortran, Coball, all of those kinds of languages are considered high level languages.
They are written in an expressive sort of way so that you can understand.
You can read the program and kind of understand what it's going for.
And Python is probably one of the most understandable programming languages that is out there on the interwebs right now.
It allows you to look over it, read your code that you've written a while ago and say, oh, okay, I understand what's going on.
Now that brings us to Python in interactive mode.
To get Python in interactive mode, what you're going to do is you're going to go to the command prompt and windows you're going to start, run, and type cmd.
There might even be a start, go to applications and click on Python.
I'm not entirely sure about that because I don't really run windows.
It looks like there is from what I can understand.
So there's a kind of a Python GUI and Python command line.
You want to do Python command line.
And what that's going to bring up is it's going to bring up what we call and we'll call the Python Chevron.
It looks like a little welcome to Python sign and then three greater than signs in a row.
That's the Python Chevron.
To give this a quick tryout type two plus two and hit enter.
And boom, it says four.
It outputs four pretty neat, huh?
Now type this.
Print, quotation mark, hello space world exclamation point, quotation mark, and then hit enter.
If you type that in correctly, print being all on lowercase words and whatever you want to type between the quotation marks is fine.
It should pop up and say, hey, look, you just told me to print this.
So I did it and it'll print it in the next line.
Interactive mode is great because it allows you to try out individual commands and build up a function and test a function automatically.
And you can can do all kinds of neat things in interactive mode.
Interactive mode is one of the reasons why Python is fantastic.
It allows you to kind of fiddle around with what Python is doing without writing a script, saving the script and trying the script and then going back and adjusting the script and so on.
Because you can try a lot of simple commands, you can try a lot of mathematical operations in interactive mode before you put them into your script.
Now script mode is when you create a text document with the extension.py.
We talked a little bit about doing this last time, how you needed the text editor.
If you want to fiddle around with it, you can make up a text document and throw a few Python commands in there and put the .py extension and then you would run Python from the command line in Linux, Python space, Python.py.
And that would be, you know, if your program's name was Python, that would run that script and do all the commands inside that script.
Now, we're going to cover a lot of vocabulary in this time around.
I would recommend that you might want to take some notes, review the vocabulary in the textbook and kind of try and use these vocabulary words as you're talking about Python.
Vocabulary words are best learned when you use them, not when you just read them or use them in flashcards.
So the first vocabulary term is input.
Input is information that you give a computer.
So if you move the mouse around the screen, you're giving it input.
If you type in hello, you're giving it input.
The computer then determines what it should do with that input given the program that's running or whatever.
Input is just information going into the computer.
You don't always see that information on your screen when you type it in, but that's the information that you're sending to your computer.
Output is what your computer does with that information.
So if you're an award processor like open office writer, then the output will just appear automatically on the screen.
Then you can adjust that output, format that output, and do all kinds of things by doing different kinds of input with your mouse and your keys and everything.
So input is information that goes into your computer, and output is information that comes out of your computer.
So output can be in the form of a graphic.
It can be in the form of music.
It can be in the form of text, formatted text, something you print off, an email that those are all kinds of output.
The next vocabulary term is a conditional.
You remember this from like geometry class where logic is covered.
Conditionals are pretty simple.
It says if the person is wearing a bow tie, then it is the alkymantis.
If the person is not wearing a bow tie, then it is not the alkymantis.
So you can see if then kinds of statements are conditional.
This is how we test for things in a computer program.
So if you're writing a computer program and you want to know if you should wear a shirt outside, for example, or a sweater.
So your statement might be like if temperature is greater than 68 degrees where a shirt.
If temperature is less than 68 degrees where a sweater.
And then that's conditional.
And there's neat things that we can do with conditionals, and we'll talk about that in a later chapter.
Repetition is just what it sounds like, repetition.
However, computers are really, really good at those things that humans are really, really bad at.
I have three classes a day that I teach the exact same thing to.
But no two classes are exactly the same because I'm a human.
I cannot repeat the exact same thing three times a day.
Plus the students give me different things to say or different ideas to address and different problems and different concepts that they understand individually.
So I'm very bad at repetition. All humans are computers, however, are very good.
If you tell a computer to repeat the letter A for the rest of its existence and don't stop it, it's going to sit there and repeat the letter A for the rest of its existence.
If you tell me to do that, I'll probably get two minutes into it and give up because I'm not very good at repetition. I'm just a human.
The next vocabulary is syntax and not s-i-n space t-a-x.
Like, you know, we're taxing drugs and alcohol, but syntax, s-y-n-t-a-x.
This is a word that, as I was reviewing for this podcast, I realized, has gone out of style in teaching grammar.
We used to teach way back, way back. It used to be taught that there's a syntax and grammar is the rules that govern syntax.
And there's a specific way of saying things in English and they should be said that way.
Well, our grammar has kind of gotten away from that and we've kind of pushed away from that.
So not as long as people understand what you're saying, it's quasi-okay.
But in computer languages, again, we're talking about a formal language and syntax is extremely important.
How you give the command to the program is extremely important.
If you're writing an essay for your English class or writing an email to your friend and you forget a period or put in an extra exclamation point, no big deal.
If you're writing a Python program and you forget a period or a decimal point or a quotation mark or an exclamation point, bam!
Your program stops working. That's it. End of game.
And when syntax is incorrect, it's called the syntax error.
And Python has a lot of ways to help you find syntax errors.
It spits out error messages and we'll look at that a little bit.
A runtime error is an error that happens not due to syntax, but due to something that is inaccurate.
So a runtime error says, oh, okay, your syntax is fine. Great.
But a runtime error is when you're running the program and it says, wait a minute, I ran out of memory.
That's bad. I can't continue going on because I'm out of RAM that I'm allowed to use.
Or Python has a few built-in limitations so that you can't run specific processes to eat up all the resources on your system.
And that would be a runtime error.
So a runtime error is not a syntax error. It's kind of an error in your programming that makes the computer program unusable.
And the final piece of vocabulary is a semantic error.
And this is an error in your logic. So when your logic is a little bit flawed and your computer program doesn't do what you want to do, that's an error in logic.
And of the three of these, I'm going to say that semantic errors are some of the hardest errors and semantic errors are some of the errors that cause the most frustration
because you have to track down where your logic fell apart and the computer just shows you the wrong results.
It doesn't necessarily tell you where the wrong results occurred and those are some of the hardest ones to find.
All right, onto our experimental debugging tip of the day.
I talked about this one earlier a little bit, but you want to test bits of your code in interactive mode.
If it works there, then take that code and put it into a .py file and then try and run that .py file.
If you are running a .py file and it keeps coming up with syntax errors, syntax errors, syntax errors, well then try each individual command and see if you've typed something differently.
Again, a syntax error is just when you've typed something wrong. It's a typo in your program.
So make sure that you're putting them exactly into interactive mode, it'll help you. Maybe if you can copy and paste, that would be ideal.
All right, here's your assignments. Assignment 1. Start Python in interactive mode by typing Python at the command prompt or clicking on Python in interactive mode or Python command line.
Type the following command, help, left parenthesis, right parenthesis.
Okay, H-E-L-P, left parenthesis, right parenthesis. That's your command right there. Hit enter and it'll start the online help program and you can follow the instructions and experiment with it.
You're not going to really hurt anything inside this help command. If you hit enter on a blank line, it might return you back to the Python in interactive mode or you can type quit in the help prompt and I believe it'll boot you out of the help prompt.
Now, after you've fiddled around with help, the help prompt a little bit and typed in various commands and read the instructions there. Try the help, left parenthesis, apostrophe, print apostrophe, right parenthesis.
And what that will do is it will tell you all about the print statement. It'll print up a little help page about the print statement and it'll give you some information, probably more information than you're ready to understand at this point of time.
But that's available for most commands in your Python library.
Now, as a note, this might not work.
Well, it might not work because you haven't installed help files yet.
It's just kind of one of those things. So if the help command does not work, check your distribution, Windows XP or Linux distribution or Mac distribution to see if you need to install the Python help files separately.
What you might also need to do is identify a Python help file directory. This right here is part of your assignment. I want you to be able to get this help to work.
Now, when you're done with playing with help, which I encourage you to do quite frequently, on to assignment two. And here's your kind of math based assignment.
Plus and a minus are plus and minus. I know that that sounds dumb when I say it, but it's the plus key on your keyboard and the minus key on your keyboard are plus and minus. That's what they represent.
The slash is the divide sign and the asterisk that little little key, if you're using the query keyboard, it's the little key above the number eight is the multiplication sign.
That will let you know that it lets you do all kinds of multiplication division subtraction addition. And you can also use parentheses.
Now, for this part of the assignment, you're going to need to remember your order of operations. And that is, please excuse my dear Aunt Sally from leaving the room. That's just the, you know, kind of a way to remember it. But you want to remember, please excuse my dear Aunt Sally.
The P stands for parentheses. E stands for exponents. M stands for multiplication. D stands for division. Then you got addition and subtraction. Please excuse my dear Aunt Sally. Those are the order of operations from top to bottom.
So here's the assignment itself. You run a 10 kilometer race in 43 minutes and 30 seconds. What is your average time per mile? What is your average speed per mile?
So there's two questions here. What is your average time per mile? So 10 kilometer race in 43 minutes and 30 seconds.
How many minutes does it take you to run one mile? And then your average speed per mile. How fast are you going? What's your per mile speed? Now, here's a hint. There are 1.61 kilometers in a mile. OK. 1.61 kilometers in a mile. Well, that's it for episode one of the illustrious programmer.
I hope that you picked up some great stuff and look forward to having you listen to the next episode.
Thank you very much.
Thank you.