TWiT Throwback (Audio)

Coding 101 11: Python: Getting Started


Listen Later

This week we are introducing our newest module, Python with Code Warrior Dale Chase!

How to Install Python

Go to Python.org and click on Python 2.7.6 under "Download". Choose the installer package for your operating system and click on them. The file will be downloaded. It is important to download 2.7 because 3.4.0 is NOT compatible with our lessons. If you want more information on what the differences are between 3.x and 2.x, please check out this handy information.

  • Note: Python is AUTOMATICALLY INCLUDED ON MacOS X ... however, you should probably download the latest rev2 version.
  • Viewer submissions and questions will be back next week!
  • To see all the code used in today's episode, go to Our Github Repository for Module 2
  • Ivory Tower

    Compiled vs. Interpreted Languages

    • Compiled languages are reduced to a set of machine-specific instructions before being saved as a executable file
    • Intepreted Languages are saved in the same format that you entered, then converted into machine language "Just in Time" - when they are needed.
      • Compiled Languages generally run faster, but are a little trickier to develop since they much be compiled for each platform that may use the program
      • Interpreted Languages generally run more slowly than Interpreted languages, but are more convienent for developers.
      • Whitespace

        • In C#, you ended a line of code by typing ";"
        • In Python, the WHITESPACE deliniated lines of code
        • Dynamic Variables

          • In C#, we had to explicitly declare variables to reserve memory space.
            • INT (Integer) = 2 Bytes 65536
            • LONG INT (Integer) = 4 Bytes 4,294,967,296
            • CHAR (Character) = 1 Byte 256
            • FLOAT (Floating Point) = 4 Bytes 4,294,967,296
            • We had to tell C# EXACTLY what type of data would be going into the variable, and it would reserve the necessary space in memory.
            • We don't have to do that in Python.
              • Variables in Python are declared AUTOMATICALLY when a value is stored in the variable.
              • Here's how it works.

                Var1 = 100 -- This becomes an INT

                Var2 = "Hello World" -- This becomes an STRING

                Var3 = "3.14" -- This becomes a FLOAT

                Python has several Data Types:

                • Numbers
                  • (int, long, float, complex)
                  • Strings
                    • Contiguous Set of Characters
                    • Lists
                      • Arrays
                      • Tuple
                        • Read-Only Lists
                        • Dictionary
                          • A Hash Table
                          • Output to Screen

                            print "Hello World"

                            or

                            Yo = "Hello World"

                            print Yo

                            Input from user:

                            • Python has a built-in function called "raw_input()"
                            • When you use this function as follows:
                            • var1 = raw_input("What's your age?")

                              print var1

                              Hosts: Fr. Robert Ballecer, SJ and Shannon Morse

                              Guest: Dale Chase

                              Get in Touch With Us!
                              • Subscribe and get Coding 101 automatically at https://twit.tv/shows/coding-101.
                              • Follow PadreSJ and Snubs on Twitter
                              • Bandwidth for Coding 101 is provided by CacheFly.

                                Sponsor:

                                • lynda.com/c101
                                • ...more
                                  View all episodesView all episodes
                                  Download on the App Store

                                  TWiT Throwback (Audio)By TWiT

                                  • 4
                                  • 4
                                  • 4
                                  • 4
                                  • 4

                                  4

                                  4 ratings


                                  More shows like TWiT Throwback (Audio)

                                  View all
                                  Total Leo (Audio) by TWiT

                                  Total Leo (Audio)

                                  202 Listeners

                                  TWiT News (Audio) by TWiT

                                  TWiT News (Audio)

                                  78 Listeners

                                  All TWiT.tv Shows (Audio) by TWiT

                                  All TWiT.tv Shows (Audio)

                                  355 Listeners

                                  TWiT Events (Audio) by TWiT

                                  TWiT Events (Audio)

                                  8 Listeners

                                  Total Mikah (Audio) by TWiT

                                  Total Mikah (Audio)

                                  3 Listeners

                                  Untitled Linux Show (Audio) by TWiT

                                  Untitled Linux Show (Audio)

                                  7 Listeners

                                  Host-Read Ads (Audio) by TWiT

                                  Host-Read Ads (Audio)

                                  3 Listeners