Pacific-Design.com

    
Home Index

1. Python

+ Arguments

+ Array

+ Binary Tree

+ Calendar

+ Date

+ Exception

+ File

+ Google Videos

+ Installation

+ JSON

+ MySQL

+ NLP

+ Pickle Shelve

+ Regex

+ Structures

+ Thread

+ UTC Local Time

+ YAML

Python /

Python - Class Instantiation

#!/usr/bin/python

class Egg:
    def __init__(self, kind = "fried"):    
        self.kind = kind

    def whatKind(self):
        return self.kind

def main():
    myEgg = Egg('scrambled')
    print(myEgg.whatKind())

if __name__ == "__main__": main()