Posts

Showing posts from August, 2021

Turtle graphics in python

Python turtle module Introduction : In computer graphics, turtle graphics are vector graphics using a relative cursor (the "turtle") upon a Cartesian plane (x and y axis). Turtle graphics is a key feature of the Logo programming language. Overview : The turtle has three attributes: a location, an orientation (or direction), and a pen. The pen, too, has attributes: color, width, and on/off state (also called down and up). The turtle moves with commands that are relative to its own position, such as "move forward 10 spaces" and "turn left 90 degrees". The pen carried by the turtle can also be controlled, by enabling it, setting its color, or setting its width. A student could understand (and predict and reason about) the turtle's motion by imagining what they would do if they were the turtle. Seymour Papert called this "body syntonic" reasoning. A full turtle graphics system requires control flow, procedures, and recursion: many turtle drawing ...

Strings in python

Image
Strings in python String are identified as a contiguous set of characters represented in the quotation marks. Python allows for either  pairs of single or double quotes.  Strings are immutable sequence data type, i.e each time one makes any changes to a string, completely new string object is created. Eg: greet = "Hello, world" print(greet) #output: Hello, world Watch our shorts videos related to python programming and more other languages , by clicking here .