Posts

Turtle Graphics

Image
Graphics is the discipline that underlies the representation and display of geometric shapes in two- and three-dimensional space. Python comes with a large array of resources that support graphics operations.  A Turtle graphics toolkit provides a simple and enjoyable way to draw pictures in a window and gives you an opportunity to run several methods with an object.  Overview of Turtle Graphics Turtle graphics were originally developed as part of the children’s programming language Logo, created by Seymour Papert and his colleagues at MIT in the late 1960s. The name is intended to suggest a way to think about the drawing process. Imagine a turtle crawling on a piece of paper with a pen tied to its tail.Commands direct the turtle as it moves across the paper and tell it to lift or lower its tail, turn some number of degrees left or right, and move a specified distance.Whenever the tail is down, the pen drags along the paper, leaving a trail. In this manner, it is possible to pr...

Python Flask Framework

  Overview of Python Flask Framework Web apps are developed to generate content based on retrieved data that changes based on a user’s interaction with the site. The server is responsible for querying, retrieving, and updating data. This makes web applications to be slower and more complicated to deploy than static websites for simple applications. There are two primary coding environments for the whole web app ecosystem. In this  will give an overview of the  Python  Flask Framework and Its best practices. Client-side Scripting The code executed on the user’s browser visible to anyone who has access to the system, generating the first results. Server-side Scripting This type of code is run on the backend on a web server. To enable developers to design, build, maintain, host web apps over the internet, a web framework necessary. What is Web Framework? A web framework is an architecture containing tools, libraries, and functionalities suitable to build and maintain ma...

University Question Papers and Answer Keys Programming in Python CST 362 KTU

     

Interfaces in Python

An abstract class and interface appear similar in Python. The only difference in two is that the abstract class may have some non-abstract methods, while all methods in interface must be abstract, and the implementing class must override all the abstract methods. Rules for implementing Python Interfaces We need to consider the following points while creating and implementing interfaces in Python  Methods defined inside an interface must be abstract. Creating object of an interface is not allowed. A class implementing an interface needs to define all the methods of that interface. In case, a class is not implementing all the methods defined inside the interface, the class must be declared abstract. Ways to implement Interfaces in Python We can create and implement interfaces in two ways − Formal Interface Informal Interface Formal Interface Formal interfaces in Python are implemented using abstract base class (ABC). To use this class, you need to import it from the abc module. Examp...