OOP Notions that are Important

OOP ( Object-oriented programming) is Object Power

Python has a Standard Library consisting of several built-in functions and many modules. Built-in functions provide programmers with abstracted functions for common programming tasks, like returning the length of an object(len()), or, like open() for opening a file, one can simply type the function: open(“< file_location >”). A module has to be imported before a program can use the classes and functions of that module. An import statement should be written at the top of a program. For example: import turtle. You can import only a part of a module, like a certain function or class, you can use the 'from' keyword. For example: from < module > import < Class_name > . We can also import our own modules and classes with the import keyword.

Is the act of representing essential features without including the background details or explanations. There is no need to necessarily understand how a module or a built-in function works at a low level in order to use it or experiment with it, so long as we carefully read the documentation.

An exception is an event, which occurs during the execution of a program that disrupts the normal flow of the program's instructions. When a Python script raises an exception, it must either handle the exception immediately otherwise it terminates and quits.

More info:

Python Exceptions Handling

A Classputs functions and variables together in a way that they can see each other and work together, be replicated, and altered as needed, and not when unneeded.A class is like a Blueprint. It describes how to make something. Supposed you want a car with different color and bigger wheels. We could use a class to describe the attributes and functions as guide to make a new car. Then you will create an instance or a new car that will use this attribute to add the different color and bigger wheel. It will still be a car but with unique attributes and functions.

A class is a block of code including a constructor which defines how an object or instance of that class will be created and what variables it will have, and also functions (referred to as methods) defining the available behaviors of objects of that class. The class definition code serves as a model and does not really do anything -- it is only when an object of that class is initialized that any functions of a class actually get used

Example of a Class & Instances structure:

Class and Instances structure:

When a new instance of a class is created, the __init__() function (constructor) defined inside of the class initializes new space in memory for the object (or instance) of that class to run. You can create lots of objects from that blueprint also known as an Instance. The instance will have the attributes and variable from the class blueprint. Instance variables are defined inside a method, normally __new__ or __init__, and they are local to that instance. Instance variables are always prefixed with the reserved word self. They are typically introduced and initialized in a constructor method named __init__. Object with (self) self is an example and can be call anything: Even though self is not a keyword, it is a convention that is used by most Python programmers.

					class Student:
						NUM_GRADES = 5
						def __init__(self, name):
							self.name = name
							self.grades = []
							for i in range(Student.NUM_GRADES):

The PVM (Python Virtual Machine) automatically calls the constructor method when the programmer requests a new instance of the class, as follows:

s = Student('Mary')

The constructor method always expects at least one argument, self. When the method is called, the object being instantiated is passed here and thus is bound toself throughout the code. Other arguments may be given to supply initial values for the object’s data Constructor.

When creating an instance method, the first parameter is always self. You can name it anything you want, but the meaning will always be the same, and you should use self since it's the naming convention. self is (usually) passed hiddenly when calling an instance method; it represents the instance calling the method.

					class Inst:

						def __init__(self, name):

						    self.name = name

						def introduce(self):
						    print("Hello, I am %s, and my name is "
						    %(self, self.name))

Now to call this method, we first need to create an instance of our class. Once we have an instance, we can call introduce() on it, and the instance will automatically be passed as self:

myinst = Inst("Test Instance")
otherinst = Inst("Another instance")

myinst.introduce()# outputs: Hello, I am < Inst object at x >, and my name is Test Instance

otherinst.introduce()# outputs: Hello, I am < Inst object at y >, and my name is An other instance

As you see, we're not passing the parameter self, it get's hiddenly passed with the period operator; we're calling Inst class's instance method introduce, with the parameter of myinst or otherinst. This means that we can call Inst.introduce(myinst) and get the exact same result.

The idea of class method is very similar to instance method, only difference being that instead of passing the instance hiddenly as a first parameter, we're now passing the class itself as a first parameter.

						class Cls:

							def introduce(cls):
								print("Hello, I am %s!" %cls)

Since we're passing only a class to the method, no instance is involved. This means that we don't need an instance at all, we call the class method as if it was a static function:

Cls.introduce() # same as Cls.introduce(Cls)

# outputs: Hello, I am < class ' Cls ' >

Notice that again Cls is passed hiddenly, so we could also say Cls.introduce(Inst) and get output "Hello, I am < class 'Inst' >. This is particularly useful when we're inheriting a class from Cls:

					class SubCls(Cls):


					SubCls.introduce() # outputs: Hello, I am <class 'SubCls'>

Similar to the idea of inheritance of visual properties in CSS -- except that in CSS inheritance is assumed to be true for any new statements/objects unless explicitly stated otherwise. In Python, there is a particular syntax, described below, for defining the child-parent relationship of classes. In both languages, inheritance offers similar benefits, in that can be used to eliminate unnecessary code (in Python, this has to do with the fact that we are reusing the parent class code), and can enhance readability.

Here is an example involving inheritance:

					class Parent():
						def __init__(self, last_name, eye_color):
							self.last_name = last_name
							self.eye_color = eye_color

					class Child(Parent):
						def __init__(self, last_name, eye_color, number_of_toys):
							Parent.__init__(self, last_name, eye_color)
							self.number_of_toys = number_of_toys

subclass ("child" class) that inherits attributes and behaviors (i.e. class variables, instance variables, and methods) of an already existing class ("parent" class).

Servers in More Detail

Network is a group or system of interconnected people or things. They are not connected directly. The idea of a network is over 3000 years old. A Node: a point at which lines or pathways intersect or branch; a central or connecting point. Latency: How much time it takes for a packet of data to get from one designated point to another. Measure in milliseconds. 1000 mls = 1 sec. Bandwidth: refers to the amount of information that can be transmitted over a network in a given amount of time, usually expressed in bits per second or bps. It is often confused with speed. Unit information divided by units of time. mbps = million bits per second. Bit: The smallest unit of computer memory. A bit holds one of two possible values, either of the binary digits 0 or 1.

Language of communication among computing devices. A network protocol facilitates device identification and data transfer. The TCP/IP Internet protocols, a common example, consist of: Transmission Control Protocol (TCP), which uses a set of rules to exchange messages with other Internet points at the information packet level. Internet Protocol (IP), which uses a set of rules to send and receive messages at the Internet address level. HyperText Transfer Protocol, HTTP is the underlying protocol used by the World Wide Web. HTTP defines how messages are formatted and transmitted, and what actions Web servers and browsers should take in response to various commands.

A cache (pronounced like cash) is something that stores data so that you don't have to retrieve it later. It can be used to make data requests faster.

An HTTP client sends an HTTP request to a server in the form of a request message which includes following format: The Request-Line begins with a method token, followed by the Request-URI and the protocol version.

Example: http://net.tutsplus.com/tutorials/other/top-20-mysql-best-practices/(The request header looks like this):

Request Header

The first line of the HTTP request is called the request line and consists of 3 parts:

  • The "method" indicates what kind of request this is. Most common methods are GET, POST and HEAD.
  • The "path" is generally the part of the url that comes after the host (domain). For example, when requesting "http://net.tutsplus.com/tutorials/other/top-20-mysql-best-practices/" , the path portion is "/tutorials/other/top-20-mysql-best-practices/".
  • The "protocol" part contains "HTTP" and the version, which is usually 1.1 in modern browsers.

Request and Response Example:

Server Request and Response

After the browser sends the HTTP request, the server responds with an HTTP response excluding the content, it looks like this:

Request & Response
Note: Server in the header could potentially give this info to a hacker The first piece of data is the protocol. This is again usually HTTP/1.x or HTTP/1.1 on modern servers. The next part is the status code followed by a short message. Code 200 means that our GET request was successful and the server will return the contents of the requested document, right after the headers.

We all have seen "404" pages. This number actually comes from the status code part of the HTTP response. If the GET request would be made for a path that the server cannot find, it would respond with a 404 instead of 200. This is a list of HTTP status messages that might be returned:

  • 200's are used for successful requests.
  • 300's are for redirections.
  • 400's are used if there was a problem with the request.
  • 500's are used if there was a problem with the server.

You can find the complete list of HTTP status codes with their explanations here.

In computer science, data validation is the process of ensuring that a program operates on clean, correct and useful data. It uses routines, often called "validation rules", "validation constraints" or "check routines", that check for correctness, meaningfulness, and security of data that are input to the system. There are several reasons that servers should validate data received by clients. One reason is site security: in order to prevent web applications and databases from being hacked, manipulated, or broken by malicious clients, servers should be able recognize bad input and deal with it appropriately. Bad data may take the form of any user input, including HTTP GET parameters in a URL or HTML form data. As a countermeasure to malicious activity, web applications should verify all data inputs on the server-side to make sure that it is of the correct type and within the constraints expected by the web application.

An equally important reason to validate user input is to ensure a favorable user experience of web apps. For example, the payment form of an online store should check the format and length of a credit card number to ensure that it is a valid card number. Imagine what happens when a user accidentally omits a number from her credit card -- the server should be able to return the form to the user with a message to re-enter the card number (in many cases the returned form should also preserve the data previously submitted by the user, although this may not be good practice for credit card numbers). If a customer is met with a blank form or has to make a phone call to the online store to confirm that their order was received, chances are they’ll simply take their business elsewhere.

Avoiding repetition is important for two main reasons: First, it reduces the opportunity to make a mistake when writing code because there is less code to write and second, like CSS, it allows us to more easily make changes while keeping the content consistent. Programmers use HTML templates for a couple of reasons: they allows us to avoid repetition and inforce consistency. Templates are libraries that allow programmers to efficiently build complicated strings, most commonly HTML strings. HTML Templates also allow programmers to keep HTML separate and avoids repetition from the files containing their web app code, as this is generally considered a best practice.

Go Explore!

Responsive Web Design (RWD) is an approach to web design aimed at crafting sites to provide an optimal viewing and interaction experience—easy reading and navigation with a minimum of resizing, panning, and scrolling—across a wide range of devices (from desktop computer monitors to mobile phones).

More Resources:
Dash by General Assembly is an online tutorial to help you learn HTML, CSS, and JavaScript and create websites from scratch. I was able to learn a lot about RWD from this website.


JavaScript is the programming language of HTML and the Web. Is an object-oriented programming language that is used to make the web browsers neat and more interactive. Javascript is an interpreted language so no special program is needed to run the code. Just a text editor and web browser is enough, thus making javascript one of the easiest languages to learn and code. In fact, JavaScript's power comes from its ability to manipulate the DOM, which is essentially a JavaScript object. When JavaScript makes something interesting happen on a website, it's likely the action happened because JavaScript changed the DOM.

More Resources:
The first lesson of JavaScript Basics from Udacity was a great resouce on how to implement some of these scripts.

JavaScript Basics (you've already taken the first lesson)

jQuery jQuery is a common JavaScript library for reading and making changes to the DOM and the DOM can change. jQuery is fast and easy to use, but it doesn't do anything you can't accomplish with vanilla (regular) JavaScript.

More Resources:
A great place to find out how to hide, show, or toggle your div with jQuery

Random Snippets

User Comments


Anonymous Wrote on 01/27/2021 at 08:59 UTC:
joy organics cbd cannabis oil <a href="https://cbdgummiesio.com/ ">cannabidiol oil </a> buy cbd https://cbdgummiesio.com/
Anonymous Wrote on 01/27/2021 at 08:54 UTC:
nuleaf cbd oil <a href=" https://cbdtincturesew.com/ ">cbd oil benefits </a> cannabinoid
Anonymous Wrote on 01/27/2021 at 08:54 UTC:
cbd for sale <a href=" https://cbdtincturesew.com/ ">fab cbd </a> cbd near me
Anonymous Wrote on 01/27/2021 at 08:54 UTC:
https://cbdtincturesew.com/ cbd hemp where can i buy cbd oil <a href="https://cbdtincturesew.com/ ">where to buy cbd oil </a> cbd hemp
Anonymous Wrote on 01/27/2021 at 08:46 UTC:
Hot teen pics http://wittyjokes.allproblog.com/?karla hied join porn young dister porn hot wife rio from bravo porn justin time porn star pics breast boob tit nipple porn
Anonymous Wrote on 01/27/2021 at 08:37 UTC:
cbd near me royal cbd <a href=" https://cbdoilforpainrx.com/ ">cannabidiol </a> cannabis tincture [url=https://cbdoilforpainrx.com/ ]cbd american shaman [/url]
Anonymous Wrote on 01/27/2021 at 08:36 UTC:
https://cbdcreamshs.com/ best cbd products what is cbd <a href="https://cbdcreamshs.com/ ">what is cbd oil good for </a> buy cbd oil online
Anonymous Wrote on 01/27/2021 at 08:30 UTC:
diamond cbd cbd gummies for sale walmart <a href="https://cbdtincturesew.com/ ">cbd effects </a> cbd pure
Anonymous Wrote on 01/27/2021 at 08:30 UTC:
https://cbdtincturesew.com/ royal cbd [url=https://cbdtincturesew.com/ ]what is cbd oil good for [/url] <a href="https://cbdtincturesew.com/ ">cbd oil stores near me </a>
Anonymous Wrote on 01/27/2021 at 08:16 UTC:
My new hot project|enjoy new website http://cpcartoonporn.amandahot.com/?kaliyah free high quality amateur porn post girls scream porn kylie interracial porn drunk lucy porn jungle book porn
Anonymous Wrote on 01/27/2021 at 08:16 UTC:
Anonymous Wrote on 01/27/2021 at 08:12 UTC:
benefits of cbd oil <a href=" https://fullspectrumcbdoilyw.com/ ">cbd oil at walmart </a> cbd oil online
Anonymous Wrote on 01/27/2021 at 08:10 UTC:
buy cbd oil https://cbdcreamshs.com/ cannabis tincture <a href="https://cbdcreamshs.com/ ">best cbd products </a> buy cbd oil
Anonymous Wrote on 01/27/2021 at 08:10 UTC:
what is a tincture cbd oil for sale joy organics <a href=" https://cbdcreamshs.com/ ">benefits of cbd </a> cbd oil online for sale [url=https://cbdcreamshs.com/ ]cbc oil [/url]
Anonymous Wrote on 01/27/2021 at 08:10 UTC:
cannabis oil [url=https://cbdcreamshs.com/ ]cannabidiol [/url] cbd tinctures <a href="https://cbdcreamshs.com/ ">american shaman cbd </a> cbd oil online for sale
Anonymous Wrote on 01/27/2021 at 08:10 UTC:
https://cbdcreamshs.com/ cbd distillery cbd oil store <a href="https://cbdcreamshs.com/ ">benefits of cbd </a> cannabidiol oil
Anonymous Wrote on 01/27/2021 at 08:08 UTC:
cbd effects benefits of cbd oil <a href="https://cbdgummiesio.com/ ">cbd hemp oil </a> cbd oil prices
Anonymous Wrote on 01/27/2021 at 08:06 UTC:
NEED ESSAY WRITING HELP? Save your time and get your essay written by a professional writer. We can cover any topic on any subject in the blink of an eye. Essay on sweaters - How to write a campaign speech for middle school ivrpy 2021. Order NOW!!! ==> https://essaypro.co [url=https://essaypro.co][img]https://a.radikal.ru/a42/1805/3f/522f9047a3e7.png[/img][/url] Winter essay conclusion Desktop support business plan Esl annotated bibliography ghostwriter for hire uk Write my custom essay on usa Homework for sociology How to write a political policy Cheap dissertation editing site online Custom home work ghostwriter website for masters Professional bibliography writers website au [url=http://izhevsk.gkrks.ru/kirpich/product/view/14/172/]Latex bibliography style dissertation - Dissertation party invitation urmqk 2021[/url] [url=http://klausy.net/blog/content/376/]Top personal essay on lincoln ttbfm[/url] [url=https://www.leptonstar.com/node/43]How to do online references in apa format tmmsx[/url] [url=http://moscow.gkrks.ru/kirpich/wienerberger/product/view/14/172/]Cheap essays editor services uk ajbdm[/url] bdc23f9 Cheap dissertation results writers sites us Mba essay chasedream Write government critical thinking HGtYUPlKMnGFW http://www.motoranch.cz/plugins/guestbook/go.php?url=https://essaypro.me/ [b]Essay on sweaters - How to write a campaign speech for middle school ivrpy 2021[/b] [url=https://essaypro.me]essay pro[/url] Cheap dissertation introduction writer sites for college Absent homework sheet Cassini huygens essay [url=http://forumg.fearnode.net/general-discussion/901750954/sample-paper-on-research-methodology-pffbw]Sample paper on research methodology pffbw[/url] [url=http://annhouse.infotown.kr/board/board2.html?mode=view&no=2625&boardcodeb=b2008102016412740]Remembering holocaust essays[/url] [url=http://1.lzludacity.appspot.com/1195478067]Need help art homework vhfeh[/url] [url=http://www.klsball.at/scripts/guestbook/index.php]Resume examples for entry level it leslt[/url] [url=https://sasheducationcampus.net/medical-education/educational-governance/?cf_er=_cf_process_600fbc8d47d46]Professional school essays ideas - Military defense policy essay full auth4 filmbay yn1ii qj html mctsg 2021[/url] tghuTRTjigFIr6F Write-My-Essay-for-Me.com Review [b]Essay on sweaters - How to write a campaign speech for middle school ivrpy 2021[/b] [url=http://www.instrumentalica.com.ua/files/apendix1170.htm]Essay interview report - Essay pregnant teenager rvuyd 2021[/url] [url=http://singimmanuel.org.uk/index.php/blog/105/]Custom thesis statement ghostwriter sites gb jeohx[/url] [url=https://matthewdascombe.com/index.php?submitted=362168]Esl letter ghostwriting for hire for mba buttl[/url] [url=http://hotpotsapa.com/2020/10/01/statement-of-goal-to-mba/]Critical essays on far from the madding crowd - Reality show business plan sample uguim 2021[/url] [url=https://essaypro.co]essay pro[/url] https://google.mn/url?q=https://studybays.com https://google.com.pe/url?q=https://studybay.ws https://www.empowher.com/users/studybay7 Breaking point book report Sports reporter resume sample Popular creative essay editor services gb [url=https://onezaym.ru]onezaim ru личный кабинет[/url] [url=http://aviasalkes.ru]Авиасалес[/url] https://homeschooleconomics.com/chris-hardwick-returns-to-host-talking-dead-after-abuse-investigation/ https://gumroad.com/1760236464158/p/loansolo-com-expert-advice-on-repairing-your-difficult-credit-score Professional thesis statement editing websites Examples of classify and divide essay Custom custom essay writers service for mba http://mmolist.com/forums/topic/essay-twelfth-night-shakespeare-fdgen/ https://www.kanecbd.com/blogs/news/cbd-absorption-calculator?comment=87541579941#comments http://baikaiyao.com/index.php/archives/5/#comment-7158 Essay on sweaters - How to write a campaign speech for middle school ivrpy 2021 https://thetournesol.com/blogs/wellness/morning-rituals?comment=97269448747#comments https://yiganerjingusa.com/blogs/blog/top-10-eczema-home-remedies?comment=95728107573#comments http://forum188.net/showthread.php?tid=5632&pid=19826#pid19826 [url=https://amarchaudhari.com.np/blog/digital-marketing-introduction/detail/]Brief history of robots essays uwmox[/url] [url=http://fkmz.webmaestro.cz/diskuze.php]Unsw school of history essay guide djkla[/url] [url=http://www.moviesforjoy.com/2018/01/30/american-gangster2007/]Compendium writing service ulbmg[/url] [url=http://dx1023.com/blog/2/]The elements of resume style ebook - Will homework be banned in geogia yrhse 2021[/url] [b]Essay on sweaters - How to write a campaign speech for middle school ivrpy 2021[/b] [url=http://sociork.com/personal-diary.php]Sample technical resume format ynkpm[/url] [url=http://www.dailymagazine.news/ex-dolphins-player-blasts-bill-belichick-s-moral-character-when-discussing-don-shula-nid-1040812.html]Resume sound technician ycvkp[/url] [url=http://www.instrumentalica.com.ua/files/apendix1170.htm]Good skill words to put on a resume payvv[/url] [url=http://forums.fearnode.net/general-discussion/901645832/football-essay-questions-jqgrs]Football essay questions jqgrs[/url] [url=https://studybay.ws]studybay[/url] Apa title page for article review Best university dissertation abstract topic Resume for owner of restaurant [b]Essay on sweaters - How to write a campaign speech for middle school ivrpy 2021[/b] [url=http://dx1023.com/blog/2/]Best argumentative essay on hillary clinton tavhs[/url] [url=http://ebaldai.lt/en/baldas/ninel]Custom paper writing websites - Pay for world affairs blog post lchrp 2021[/url] [url=http://e-tourismafrica.com/presentation-du-tourisme-en-ligne/]Psychology extended essay example ztjwx[/url] [url=https://wiescirolnicze.pl/partnerzy/]Architect project manager resume grefx[/url] [url=http://a-carbonsds.ru/guestbook]Essay about my english lesson ikxnu[/url] [url=https://www.fanatigkw.com/product/foldable-stereo-headphone/]German gcse coursework school bnajo[/url]
Anonymous Wrote on 01/27/2021 at 08:06 UTC:
https://fullspectrumcbdoilyw.com/ what does cbd do cbd pain cream <a href="https://fullspectrumcbdoilyw.com/ ">buy cbd oil best cbd oil for sale </a> hemp oil for pain
Anonymous Wrote on 01/27/2021 at 08:04 UTC:
what does cbd do buy cbd oil <a href=" https://cbdoilforpainrx.com/ ">cbd oil prices </a> cbd cream for pain [url=https://cbdoilforpainrx.com/ ]cbd hemp oil [/url]
Anonymous Wrote on 01/27/2021 at 08:02 UTC:
cbd oil online for sale [url=https://cbdgummiesio.com/ ]diamond cbd [/url] hemp seed oil benefits fab cbd
Anonymous Wrote on 01/27/2021 at 07:57 UTC:
cannabinoid cbd oil near me <a href="https://cbdtincturesew.com/ ">cbd products </a> cbd for sale
Anonymous Wrote on 01/27/2021 at 07:57 UTC:
cbd hemp oil https://cbdtincturesew.com/ hemp oil for pain <a href="https://cbdtincturesew.com/ ">cbd oil for sale near me </a> cbd oil
Anonymous Wrote on 01/27/2021 at 07:57 UTC:
cbd gummies near me <a href=" https://cbdtincturesew.com/ ">cbd pain cream </a> cbd for sleep
Anonymous Wrote on 01/27/2021 at 07:50 UTC:
cbd oil stores near me [url=https://fullspectrumcbdoilyw.com/ ]cbd oil for sale near me [/url] cbd drops <a href="https://fullspectrumcbdoilyw.com/ ">nuleaf cbd oil </a> buy cbd oil best cbd oil for sale