Skip to main content

Posts

Four Square pattern using Python program

Four Square Pattern import turtle turObj = turtle.Turtle() turObj.getscreen().bgcolor("#555555") turObj.speed(5000) def star(turtle, size):     if size <=5:         return     else:         for i in range(4):             turObj.color("#FFFFFF")             turtle.forward(size)             star(turtle,size/2)             turtle.left(270) star(turObj,100)        turtle.done() Output:
Recent posts

Inserting,Deleting and Updating table values in Database using Python Programming

Insert,Delete and Update import tkinter as tk from tkinter import * import mysql.connector import datetime def IsValidDate(InputDate):     day = InputDate[:2]     month = InputDate[3:5]     year = InputDate[6:]         IsValid = True         try :         datetime.datetime(int(year),int(month),int(day))     except ValueError :         IsValid = False     return IsValid def FormatDBDate(InputDate):     dt = InputDate[6:] + "-" + InputDate[3:5] + "-" + InputDate[:2]     return dt    def FormatEDDate(InputDate):     dt =  InputDate[8:] + "/" + InputDate[5:7] + "/" + InputDate[:4]     return dt  def DeleteEmployee(id, eid, ename, dob, doj, adr, cty, pcd, mob, eml, gen, dep):     conn=mysql.connector.connect(user='root',password='harsha',host='localhost', datab...

Creating a Realtime Clock using Python program

Clock from turtle import * from datetime import datetime def jump(distanz, winkel=0):     penup()     right(winkel)     forward(distanz)     left(winkel)     pendown() def hand(laenge, spitze):     fd(laenge*1.15)     rt(90)     fd(spitze/2.0)     lt(120)     fd(spitze)     lt(120)     fd(spitze)     lt(120)     fd(spitze/2.0) def make_hand_shape(name, laenge, spitze):     reset()     jump(-laenge*0.15)     begin_poly()     hand(laenge, spitze)     end_poly()     hand_form = get_poly()     register_shape(name, hand_form) def clockface(radius):     reset()     pensize(7)     for i in range(60):         jump(radius)         if i % 5 == 0:           ...

8-Star Design using Python program

8-Star Design import turtle turObj = turtle.Turtle() turObj.getscreen().bgcolor("#555555") turObj.speed(10) def star(turtle, size):     if size <=5:         return     else:         for i in range(8):             turObj.color("#98F798")             turtle.forward(size)             star(turtle,size/6)             turtle.left(135) star(turObj,300)      turtle.done() Output:

Star Design using Python program

Star Design import turtle turObj = turtle.Turtle() turObj.getscreen().bgcolor("#555555") turObj.speed(10) def star(turtle, size):     if size <=10:         return     else:         for i in range(30):             turObj.color("#FEACFF")             turObj.forward(i * 15)             turObj.right(144)            star(turObj,100)        turtle.done() Output: