Posts

Mad Libs Generator using Python

  This python beginner project is a good start for beginner software developers as it has concepts like strings, variables, and concatenation. Mad Libs Generator teaches to manipulate user-inputted data as the Mad Libs refer to a series of inputs that a user enters. The input from the user could be anything from an adjective, a pronoun, or even a verb. After all the inputs are entered the application takes all the data and arranges it to build a story template.  Here is the Source Code👇 """ Mad Libs Generator ---------------------------------------- """ #Loop back to this point once code finishes loop = 1 while (loop < 10): #All the questions that the program asks the user     noun = input("Choose a noun: ")     p_noun = input("Choose a plural noun: ")     noun2 = input("Choose a noun: ")     place = input("Name a place: ")     adjective = input("Choose an adjective (Describing word): ")     noun3 = inp...

Draw Indian Flag using Python turtle

Image
  Source Code:- # required module-pip install turtle import turtle # inializing a turtle flag = turtle.Turtle() turtle.bgcolor("black") # for creating first reactangle flag.begin_fill() flag.fillcolor("orange") flag.forward(500) flag.right(90) flag.forward(100) flag.right(90) flag.forward(500) flag.right(90) flag.forward(100) flag.right(90) flag.end_fill() # for second rectangle flag.right(90) flag.forward(100) flag.begin_fill() flag.fillcolor("white") flag.forward(100) flag.left(90) flag.forward(500) flag.left(90) flag.forward(100) flag.left(90) flag.forward(500) flag.end_fill() # for third rectangle flag.begin_fill() flag.fillcolor("green") flag.left(90) flag.forward(200) flag.left(90) flag.forward(500) flag.left(90) flag.forward(100) flag.left(90) flag.forward(500) flag.end_fill() #big blue circle flag.penup() flag.setpos(250,-105) flag.pendown() flag.begin_fill() flag.fillcolor("navy") flag.circle(45) flag.end_fill() #big white circ...

Python Program for Tower of Hanoi

Image
 Tower of Hanoi is a mathematical puzzle where we have three rods and n disks. The objective of the puzzle is to move the entire stack to another rod, obeying the following simple rules:  1) Only one disk can be moved at a time.  2) Each move consists of taking the upper disk from one of the stacks and placing it on top of another stack i.e. a disk can only be moved if it is the uppermost disk on a stack.  3) No disk may be placed on top of a smaller disk. Source Code:- # Recursive Python function to solve the tower of hanoi def TowerOfHanoi(n , source, destination, auxiliary):     if n==1:         print "Move disk 1 from source",source,"to destination",destination         return     TowerOfHanoi(n-1, source, auxiliary, destination)     print "Move disk",n,"from source",source,"to destination",destination     TowerOfHanoi(n-1, auxiliary, destination, source)  # Driver code n = 4 Towe...

Draw Among Us Game Character using python turtle graphics

  Source Code :- import turtle BODY_COLOR = 'Red' BODY_SHADOW = '' GLASS_SHADOW = '' GLASS_COLOR = 'skyblue' s= turtle.getscreen() t= turtle.Turtle() # WE WILL DIVIDE CHARACTER INTO 3 PARTS : # BODY , GLASS, BACKPACK # FIRST CREATE BODY() def body():     t.pensize(20)     t.fillcolor(BODY_COLOR)     t.begin_fill()     #Right side     t.right(90)     t.forward(50)     t.right(180)     t.circle(40, -180)     t.right(180)     t.forward(200)          #head curve     t.right(180)     t.circle(100, -180)     #Left side     t.backward(20)     t.left(15)     t.circle(500,-20)     t.backward(20)          #t.backward(200)     t.circle(40,-180)     t.left(7)     t.backward(50)     #hip     t.up()     t.left(90)  ...

Wish Happy Friendship Day using Python turtle graphics

  Source Code:- import turtle screen=turtle.Screen() trtl=turtle.Turtle() screen.setup(620,620) screen.bgcolor('white') clr=['red','green','blue','yellow','purple'] trtl.pensize(4) trtl.shape('turtle') trtl.penup() trtl.pencolor('red') trtl.write(str(),align="center",font=("Arial", 12, "normal"))      trtl.home() trtl.setpos(0,-250) trtl.pendown() trtl.pensize(10) trtl.pencolor('blue') trtl.circle(400) trtl.penup() trtl.setpos(-370,100) trtl.pendown() trtl.pencolor('green') trtl.write('Happy friendship day',font=("Arial", 14,"normal")) trtl.color("red") trtl.begin_fill() trtl.penup() trtl.setpos(-70,200) trtl.pensize(5) trtl.left(50) trtl.forward(133) trtl.circle(50,200) trtl.right(140) trtl.circle(50,200) trtl.forward(133) trtl.end_fill() trtl.hideturtle() turtle.done()

Draw Virat Kohli's Cartoon face using python turtle graphics

Image
 In this Article I'll share the Source Code to draw Virat kohli's Cartoon face using python turtle graphics.  Source Code:- from turtle import * vk=Turtle() s=Screen() s.bgcolor("NavajoWhite2") vk.speed(1) vk.penup() vk.setposition(0,-200) vk.pendown() vk.begin_fill() vk.color('black') vk.right(75) vk.circle(100,90) vk.right(13) vk.forward(180) vk.circle(100,90) vk.forward(80) vk.right(-200) vk.circle(40,-90) vk.circle(80,-26) vk.right(90) vk.forward(140) vk.circle(50,90) vk.right(80) vk.circle(200,30) vk.right(120) vk.circle(1000,-26) vk.right(85) vk.circle(110,95) vk.right(-140) vk.backward(30) vk.right(60) vk.backward(50) vk.speed(1) vk.right(20) vk.forward(63) vk.right(120) vk.speed(1) vk.circle(50,45) vk.right(-30) vk.forward(240) vk.right(95) vk.circle(300,34) vk.right(40) vk.forward(50) vk.left(10) vk.forward(80) vk.right(90) vk.forward(150) vk.right(95) vk.backward(60) vk.right(-30) vk.forward(50) vk.speed(1) vk.right(-30) vk.forward(100) vk.right(80) ...

Draw a Carromboard using python turtle graphics

Image
In this Article I'll share the source Code to draw A carromboard using Python turtle graphics. I hope that you will like it and share with those who need it.  Source Code :- def squares(x,y,f,p,c):  t.speed(0)  t.up()  t.goto(x,y)  t.down()  t.begin_fill()  t.pensize(p)  t.pencolor(c)  t.fillcolor(c)  for i in range(4):   t.forward(f)   t.left(90)  t.end_fill() def outline(x,y,f,p,c):  t.speed(0)  t.up()  t.goto(x,y)  t.down()  t.pensize(p)  t.pencolor(c)  for i in range(4):   t.forward(f)   t.left(90) def circlefill(x,y,r,c):   t.speed(0)   t.up()   t.goto(x,y)   t.down()   t.begin_fill()   t.fillcolor(c)   t.circle(r)   t.end_fill()   def circlefillout(x,y,r,c):   t.speed(0)   t.up()   t.goto(x,y)   t.down()   t.pencolor(c)   t.begin_fill()   t.fillcolor(c)   t.circle(r)   t.end_fill...