Showing posts with label Python. Show all posts
Showing posts with label Python. Show all posts

11/04/2019

Python Pattern

 

Python Pattern

def pattern(n):
    num=65
    for i in range(0,n):
        for j in range(0,i+1):
            print(chr(num),end=" ")
        num = num + 1
        print("\r")
              
pattern(9)

7/01/2019

Windows Logo (Python)

 

Windows Logo (Python)
Windows Logo (Python)

from turtle import *
speed(1)
bgcolor('black')
penup()
goto(-50,60)
pendown()
color("#00adef")
begin_fill()
goto(100,100)
goto(100,-100)
goto(-50,-60)

goto(-50,60)
end_fill()

color("black")
goto(15,100)
color("black")
width(10)
goto(15,-100)
penup()
goto(100,0)
pendown()
goto(-100,0)
done()

4/05/2019

Python (Turtle Library)

Python Program (Turtle Library)
Python Program (Turtle Library)
 


import turtle
t=turtle.Turtle()
s=turtle.Screen()
s.bgcolor('white')
t.pencolor('red')
t.speed(0) #change the speed value 
for i in range(45):
    t.circle(190-1,90)
    t.lt(98)
    t.circle(190-1,90)
    t.lt(18)

4/03/2019

Colorful Hexagon in python

Colorful Hexagon in python

 
import turtle
colors=["green","orange","red","blue","purple","yellow"]
t=turtle.pen()
turtle.bgcolor("black")
turtle.speed(0) 
for i in range(250):
    turtle.pencolor(colors[i%6])
    turtle.width(i//100+1)
    turtle.forward(i)
    turtle.left(59)