In this video, I will explain the basics of Object Oriented Programming with Python. Understand that a Class is the blue print that defines what Attributes (variables) and Methods (functions), each object it builds must have.
Each Object that is created is said to be an Instance of the Class that built it. I’ll also go over what Encapsulation is. Encapsulation is how you hide information and constrain a user of your class to use it in the way you define. And, finally I teach you how to enforce Encapsulation by making your Attributes and Methods private.
Like always, a lot of code follows the video. If you have any questions or comments leave them below. And, if you missed my other Python Tutorials they are available here:
In this video I’ll explain how to use functions in Python 2.5 through 2.7. I’m going to cover how to:
Create Functions
Pass Values to Functions
Create Default Values
Except Unlimited Arguments
Except Unlimited Key Value Pairs
Use Recursion
and more…
Like always, the code follows the video. If you have any questions or comments leave them below. And, if you missed my other Python Tutorials they are available here:
Here is Some Code that Demonstrates using Python Functions
#! /usr/bin/python
# Define a docstring a special function attribute
globalVariable = 10
def addNumbers(NumOne=1,NumTwo=1):
‘Adds the numbers passed to it’
return NumOne + NumTwo
def addUndefNums(NumOne=1,NumTwo=1,*args):
‘Adds the numbers passed to it’
finalValue = NumOne + NumTwo
if args:
for i in args:
finalValue += i
return finalValue
else:
return finalValue
def createDict(**kvargs):
for i in kvargs:
print i, kvargs[i]
print type(kvargs[i])
print type(kvargs)
print kvargs
return
def factorial(num):
if num == 1:
return 1
else:
return num * factorial(num – 1)
def printNames(first,last):
pass
def main():
# Demonstrate difference between global & local scope
mainNumber = 5
print “mainNumber equals”, mainNumber, “in function main”
scopeFunction()
print “mainNumber equals”, mainNumber, “after scopeFunction”
print id(mainNumber)
# Force a global variable to change
print “globalVariable before changeGlobal =”, globalVariable
changeGlobal()
print “globalVariable after changeGlobal =”, globalVariable
# Create a function with a docstring
print addNumbers(1)
print addNumbers.__doc__
# Add undefined number of numbers with a tuple
print addUndefNums(1,2,3,4,5,6,7,8)
# Create a dictionary
createDict(Name=’Derek’, Age=35, YearBorn=1974)
createDict(Cust1=(‘Derek’,35,1974),Cust2=(‘Sally’,25,1984),Cust3=(‘Paul’,15,1994))
I continue the Python 2.7 Tutorial by explaining a couple new things. I first go over how to turn your Python code into an executable application.
I then cover Python Conditionals. Conditionals are used to perform certain actions under one condition and other actions based on other conditions. In Python you can do this either with an IF Statement, or with something called a Conditional Expression.
Like always, the code follows the video. If you have any questions or comments leave them below. And, if you missed my other Python Tutorials they are available here:
In this article I provide you with two videos that will explain how to read financial statements.
In the first video, I cover how the following effect your financial statements: Paying off Debt, Hiring an Employee, Buying with Credit, the Accrual Method, the Cash Method.
In the second video, I cover how product and service business balance sheets differ. I compare accrual method income statements to cash method income statements.
In this video tutorial I explain how to create financial statements. I use an example business and walk you though how balance sheets and income statements are effected by business transactions.
Here I finish going over how people go through the process of Decision Making. If you haven’t, watch the first Decision Making videos here. Each person makes each decision in very specific ways. If you understand how they make decisions you will find it very easy to negotiate and persuade them into believing what ever you would like.
To find out how they make decisions, you just need to ask them one question. If you then structure your negotiation in a way that is compatible with their way of making decisions you dramatically increase your persuasiveness.
In the videos here and in the previous article, I teach you the questions to ask and all of the many ways people make decisions. These are high level negotiation techniques and if you want to see them put into use in a more understandable way, check out my sales technique videos. (They are free also)
Yesterday I wrote about the Study Methods I researched over the years. Since it seems to be of interest to many of you, I created a nice YouTube video on the subject.
These are the exact methods I followed while working 2 jobs (one out of state) through out my college career. I still use these methods to this day to create mountains of information for you.
In the previous article I answered many of the WordPress How To Questions that I’ve been getting. Many of you also requested that I create a video based on that article, so here you are.
In this video I’ll cover the following topics:
Quick ways to post content to your site
How to Upgrade WordPress
3 different ways to install themes
How to backup WordPress
And, a couple of WordPress tips
Here is the video and after it I provided links to a bunch more WordPress How To Videos and articles.
Here I provide a video of me making my favorite meal. It is extremely easy to make, delicious and healthy. It is called Salmon Favetta with a Radish, Celery and Lemon Citronette.
For the salmon, make sure that it is fresh (not frozen or precooked). Get two normal sized fillets for this specific recipe. Then follow the directions below to make the Favetta and Citronette.
Note: The Citronette will taste a little bitter by itself, but totally dreamy over the salmon and Favetta. Trust me on that and don’t mess with the recipe!
This article and video was created because of the requests from Gent2910 and others. You guys have been having problems understanding a few concepts with Python. Specifically you’ve asked for:
More examples on unconventional uses for functions
Most people get really popular on YouTube, by posting video’s of their baby on there. I thought I’d do the opposite.
After recently getting made a YouTube partner, I knew I could finely post my baby’s first year video.
It’s amazing how helpless they are, and how much they enrich your life. This has been a very special year and I hope you enjoy it with me, in the video below.