Yo! If you’ve been reading my blog so far you’ve probably seen that all of my posts have been about learning Python. And I guess that’s been going alright, but it’s a bit repetitive yeah? I mean it’s important to get the basics down and all, and I’ll certainly continue making those sorts of posts, but I figure it’s nice to have some variety. And after having already been through these subjects in college I find myself wanting more.
So today I found my flash drive from my college course almost a year ago that has all my files, one of these files being a game I tried to code as part of a project! It was basically a Galaga clone. It was our first project, and we hadn’t really had that much practice so it had to be something simple 🙂 One thing though, I never finished it! I remember getting some basic things down like player movement and *kind of* getting the enemies to work and then all of a sudden everything just kinda…stopped working. And of course it being a timed project and all, after the assignment was due I was busy with other stuff and never really got back to finishing it.
But now that’s going to change! Now that I have the source code, I plan on looking through it and attempting to make sense of it all (if that’s even possible). Then I’ll try to relearn anything I need to (I haven’t programmed in C++ for a while) and complete my game. Should be interesting 🙂
Anyway, later today or tomorrow I’ll have a look through the code and see how bad it is (I’m assuming very) and see where to go from there. So the next few posts will either be about me relearning C++ or my process of coding the game. See you then!
Good morning everyone! Since I’ve personally been using these last few days to practice my programming skills, I thought I’d go ahead and compile a list of resources that I’ve heard of or used to help me learn Python. I’ve organized the list by the type of resource, and I’ve only added resources that are free, although a couple of them have paid options.
Important note: although my blog focuses on Python 3, some of these resources may focus on teaching Python 2. The principles of programming that they teach however are still the same.
Now let’s start going through the list!
Read more ›
Tagged with: Code
, computer science
, Learn Programming
, Learn Python
, Online Resources Learn Python
, Python programming
Posted in Programming
Hello! Before we go further into our CodingBat practice, I think it would be beneficial to learn more about strings in Python, something I probably should’ve gone over earlier. So, this post will explain what strings are and how we can interact with them.
What are Strings?
Strings are basically a sequence of individual characters. As we already know, to declare a string in Python we enclose it in quotations, like “Hello World”. To declare a variable as a string, we would just type in:
my_string = "Hello World"
Now, let’s talk about what strings really are. Although strings have their own data type, in reality strings are actually lists of individual characters. Consequently, we are able to interact with strings in some of the ways we did with lists. For example: Read more ›
Hey everyone! In the last blog post we learned about interacting with lists and list methods. If you’ve been following along with me and the blog, we’ve learned quite a bit since the first blog post. At least enough to where it’s probably a good idea to stop and see if we understand what we’ve learned so far. It’s easy to think that you understand a concept in programming, and then end up staring at the screen with a blank face when you’re faced with an actual problem. I would know 🙂
So in this post, I’ll be using a site called CodingBat to attempt practice exercises and actually put what we’ve learned so far to use! Every once and a while I’ll break up the usual posts with these practice posts so that we can actually see the things we’ve learned in action. And it probably won’t always be CodingBat, especially when we get on to other languages, since CodingBat only has a limited number of exercises, and only for Java and Python. But anyhow, let’s start with CodingBat.
Read more ›
Greetings! In the last blog post, we learned about lists and for-loops. In this post, we’ll learn about some of the useful methods Python gives us to interact with lists. Oh and while trying to format longer source code in this post I finally looked up how to post better looking source code on WordPress, so now the code on here should be a bit more readable. : ) Although keep in mind the color scheme for code in the post won’t be the same as it is in our Eclipse IDE (e.g. the keyword “print” is pink instead of blue). So don’t freak out about that. Anyway let’s get going with the list methods.
Read more ›
Hello again! Earlier, we learned about the basics of while-loops and if-statements. In this post, we’ll be learning about lists and for-loops, and how to combine them with our knowledge of while-loops and if-statements.
What are Lists?
A list in Python is one of several data types, called containers, that can hold more than one value. Of the several different types of containers, lists are the simplest. An example of how to declare a list would be:
days_of_the_week = ['Sunday','Monday','Tuesday','Wednesday',
That’s it! Just declare a variable, enclose your list in brackets, and use commas to separate the individual items. An example of how to use a list in a program would be:
Read more ›
Howdy everyone. In the last post, we learned about variables, data types, and created a program that stored user input and used that input to solve a math formula. In this post, we’ll learn about if-statements and while-loops.
In programming, there are many cases where you’ll need to do something more than once, or keep the program running until the user wants to quit. For example, if we’re programming a game, we want the user to be able to keep playing until they want to quit. We don’t want to make them restart the program each time. That’s what while-loops are for. Let’s go with something easy and make a program that prints the numbers 1 through 10. Read more ›
Hello! Now that we know some of the basics of printing, it’s time to learn a little bit about variables and then use that knowledge to make a program that handles user input. At the end of the post, we’ll have a program that takes user input and uses it to solve a math problem (exciting!). First, we’ll type in some code in the Eclipse editor and then we’ll go over what each part of the code means.
print("Hello there! What's your name?" )
user_input = input ("Enter your name : ")
print("Howdy ", user_input , "!")
Run the code in Eclipse, then click inside the console at the bottom, type in your name, and press Enter. If you copied the code exactly as above, you should see this: Read more ›
In the last blog post, we installed Python and Eclipse onto our computer and wrote a basic “Hello World!” program. Now it’s time to learn more about printing in Python.
Basics of Printing In Python
As we saw in the last post, to print a phrase in Python you just use print(), with your phrase of choice (surrounded by quotation marks) going inside the parentheses. “print()” is what’s referred to as a function, which is basically a piece of code that executes a command, in this case, the function tells the editor to print whatever you put in the parentheses. The stuff you type into the parentheses is known as an argument, which is just a value you give the function to act on. So, in our hello world program:
“print” is the function and “Hello World!” is the argument.
Read more ›
Hello everyone! I’ve decided to begin relearning programming with the Python language. In this post I will simply go through installing Python as well as Eclipse with PyDev, which is the program I will be using to edit and run Python code.
Installing Python on your PC
First off, you can download the newest version of Python here. Please note that if you are reading this blog with the intention of following along with my projects and learning experiences you need to download the newest version of Python, which at the time of writing this post is 3.4.1. This is because the Python developers changed quite a bit between Python 2 and Python 3, and trying to go along with Python 2 will just be confusing.
Read more ›