CSC108H5 Lecture Notes - Lecture 13: Object-Oriented Programming, Init

184 views3 pages
Verified Note
11 Dec 2018
School
Course
Professor

Document Summary

Python is an object oriented programming language. This means it manipulates and works with data structures called objects. Objects can be anything that could be names in python : These objects have equal status in python. They can be used anywhere an object is required. They can be assigned to a variable , list or dictionary. They can also be passed as arguments. A class is simply a way of organising , managing and creating objects with the same attributes and methods. In python, you can define your own classes , inherit from your own defined classes or built. To define a class you can use class" , a reserved keyword, followed by classname and a colon. Example: class students: pass to create a class that taken an object : class students(object) Immediately after creating an instance of the class you will have to call the __init__() function. This function initializes the objects its creates.

Get access

Grade+20% off
$8 USD/m$10 USD/m
Billed $96 USD annually
Grade+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
40 Verified Answers
Class+
$8 USD/m
Billed $96 USD annually
Class+
Homework Help
Study Guides
Textbook Solutions
Class Notes
Textbook Notes
Booster Class
30 Verified Answers

Related Documents