TWiT Throwback (Audio)

Coding 101 18: Python: Defining Functions


Listen Later

Welcome to Coding 101 - It's the TWiT show that gives YOU the knowledge to live in the wonderful world of the programmer. This week we are introducing our newest module, Python with Code Warrior Dale Chase!

To see all the code used in today's episode, go to Our Github Repository for Module 2

Ivory Tower

Let's Define some Functions!

  • Functions can be defined in Python using the "def" keyword in the form "def FunctionName(Variable)"
  • The variable listed in parentheses is the parameter that can be passed to the function when it is being called
  • Usage:

    def myfunction(var1):

    ... print "Hello World!"

    ... print var1

    • This example function will print "Hello World" then print the value of the "var1" variable
    • If we want to return a value to the code that called the function, we use "return variablename"
    • 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.

        Sponsors:

        • squarespace.com offer code CODING
        • shutterstock.com offer code CODING514
        • ...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