{"title":"Classes","authors":"Allen W. Wood","doi":"10.4324/9781003070863-8","DOIUrl":"https://doi.org/10.4324/9781003070863-8","url":null,"abstract":"In this chapter, we introduce classes, which is a fundamental concept in programming. Most modern programming languages support classes or similar concepts, and we have already encountered classes earlier in this book. Recall, for instance, from Chapter 2 how we can check the type of a variable with the type function, and the output will be of the form <class ’int’>, <class ’float’>, and so on. This simply states that the type of an object is defined in the form of a class. Every time we create, for instance, an integer variable in our program, we create an object or instance of the int class. The class defines how the objects behave and what methods they contain. We have used a large number of different methods bound to objects, such as the append method for list objects and split for strings. All such methods are part of the definition of the class to which the object belongs. So far, we have only used Python’s built-in classes to create objects, but in this chapter we will write our own classes and use them to create objects tailored to our particular needs.","PeriodicalId":83531,"journal":{"name":"Wissenschaftliche Zeitschrift der Karl-Marx-Universitat Leipzig. Mathematisch-naturwissenschaftliche Reihe","volume":"35 1","pages":""},"PeriodicalIF":0.0,"publicationDate":"2020-10-07","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":null,"resultStr":null,"platform":"Semanticscholar","paperid":"87468326","PeriodicalName":null,"FirstCategoryId":null,"ListUrlMain":null,"RegionNum":0,"RegionCategory":"","ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":"","EPubDate":null,"PubModel":null,"JCR":null,"JCRName":null,"Score":null,"Total":0}