From 3af354fbcad463e8975352ae9436d641e9c84fb6 Mon Sep 17 00:00:00 2001 From: Asabeneh Date: Tue, 10 Dec 2019 19:24:32 +0200 Subject: [PATCH] day 21 fixes --- readme19-21.md | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/readme19-21.md b/readme19-21.md index e67cb95..ce2fe62 100644 --- a/readme19-21.md +++ b/readme19-21.md @@ -704,6 +704,38 @@ We use *json()* method from response object, if the we are fetching JSON data. F Python is an object oriented programming language. Everything in Python is an object, with its properties and methods. A number, string, list, dictionary,tuple, set etc. used in a program is an object of a corresponding built-in class. We create class to create an object. A Class is like an object constructor, or a "blueprint" for creating objects. We instantiate a class to create an object. The class defines attributes and the behavior of the object, while the object, on the other hand, represents the class. We have been working with classes and objects right from the beginning of these challenge unknowingly. Every element in a Python program is an object of a class. +Let's check if everything in python is class: +```py +Last login: Tue Dec 10 09:35:28 on console +asabeneh@Asabeneh:~$ pyhton +-bash: pyhton: command not found +asabeneh@Asabeneh:~$ python +Python 3.7.5 (default, Nov 1 2019, 02:16:32) +[Clang 11.0.0 (clang-1100.0.33.8)] on darwin +Type "help", "copyright", "credits" or "license" for more information. +>>> num = 10 +>>> type(num) + +>>> string = 'string' +>>> type(string) + +>>> boolean = True +>>> type(boolean) + + +>>> lst = [] +>>> type(lst) + +>>> tpl = () +>>> type(tpl) + +>>> set1 = set() +>>> type(set1) + +>>> dct = {} +>>> type(dct) + +``` ### Creating a Class To create a class we need the key word **class** followed by colon. Class name should be **CamelCase**. ```sh