This website uses third party cookies exclusively to collect analytics data and to track user progress. If you continue browsing or close this notice, you accept use of cookies for these purposes.
Learn about this website's cookiesDisallow cookies

Python Lessons

The easiest way to explain what coding is, is to say that coding is typing in the code. Coding is like writing, but in a specific computer language. Programming means writing up your own code. It is like writing in foreign language. A programmer (or developer) is a person who writes a code. A programmer is like a writer, who writes a book. Programs are lines of code that is understandable for computers. So programs are books written in a computer language and computer is the reader of this code.
Technology is becoming incredibly important throughout the world. Demand is increasing on a daily basis for programmers to create that technology.
Python is a programming language that computers understand. It is also a program which interprets other programs that are written in Python. But we will discuss interpretation in the next chapter.

A print statement looks like this: print("Hi, my name is Cody!") This code prints the message Hi, my name is Cody! in the console. It doesn’t do much other than that. Be sure to add the text you want to be printed between ( ) and " ". Are you ready to revolutionize the tech industry?
The if-else statement determines the execution of code based on certain circumstances. They are used very frequently in programming for making decisions. The else part of the statement is executed only when the if part is not considered to be true.

For example:
if a == b:
   print("The numbers are equal")
   print("The numbers are different")

A programmer can define a variable in their code and set it to be a specific value. For example, you can assign the value of 2 to the variable a by typing a = 2, and now any time you need to access the number 2, you can use the variable a instead. There are very pracitcal uses for this that we will go into further as we learn more about programming.
Obviously you are accustomed to the equals sign =, but it has a specific use in Python. The equals sign is used for assigning a value to a variable. For example, n = 3. However, two equals signs do not perform the same action. Two equals signs are used for comparison. For example, to determine if variable t is equal to 10, you would write t == 10.
At the beginning we mentioned that a program is written like a book, but using a programming language instead of a spoken language. As such, the order of the lines in a program are important, just are they are in a book. It would be very difficult to understand the expected organization of a book if the lines were not in their proper order. The same is true for computer programs. Python programs run from beginning to end, so if you need to use a variable on line 100, you must have declared that variable before that point in the code.
In completing tasks, it is important to note that they are organized logically by difficulty: flashcards, code output, fill-in the blanks, debugging, build it yourself. For the best experience, you should complete the first tasks before continuing to the next.


Print Your name!

We'd love to hear your feedback!