from turtle import *
speed(0)
bgcolor('black')
color('orange')
hideturtle()
n = 1
p = True
while True:
circle(n)
if p:
n = n - 1
else:
n = n + 1
if n == 0 or n == 60:
p = not p
left(1)
forward(3)
done()
speed(0)
bgcolor('black')
color('orange')
hideturtle()
n = 1
p = True
while True:
circle(n)
if p:
n = n - 1
else:
n = n + 1
if n == 0 or n == 60:
p = not p
left(1)
forward(3)
done()
from turtle import *
import turtle
turtle.bgcolor('black')
turtle.pencolor('red')
turtle.hideturtle()
turtle.speed()
#curve01
def curve01(a,d):
for i in range(d):
turtle.right(a)
turtle.forward(1)
#making eye
turtle.width(15)
turtle.penup()
turtle.right(90)
turtle.forward(85)
turtle.left(90)
turtle.forward(35)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.left(55)
curve01(0.09,100)
curve01(0.2,100)
turtle.forward(70)
turtle.right(90)
curve01(0.5,100)
curve01(00,30)
curve01(0.3,50)
curve01(0.6,50)
turtle.forward(50)
turtle.right(47)
curve01(0.1,95)
turtle.end_fill()
#changing
turtle.penup()
turtle.left(36)
turtle.forward(70)
turtle.pendown()
#curve02
def curve02(a,d):
for i in range(d):
turtle.left(a)
turtle.forward(1)
#second eye
turtle.fillcolor('white')
turtle.begin_fill()
turtle.right(55)
curve02(0.09,100)
curve02(0.2,100)
turtle.forward(70)
turtle.left(90)
curve02(0.5,100)
curve02(00,30)
curve02(0.3,50)
curve02(0.6,50)
turtle.forward(50)
turtle.left(47)
curve02(0.1,95)
turtle.end_fill()
turtle.penup()
turtle.width(0)
turtle.right(49)
turtle.forward(30)
turtle.left(102) #100.40
turtle.forward(145)
turtle.pencolor('red')
#making left face
turtle.fillcolor('red')
turtle.begin_fill()
turtle.speed()
turtle.pendown()
turtle.left(90)
curve01(5,20)
turtle.left(175)
turtle.forward(50)
turtle.left(25)
turtle.forward(28)
turtle.right(160)
turtle.forward(170)
curve02(0.2,65)
turtle.right(60)
curve01(0.1,140)
curve01(0.5,50)
turtle.left(180)
curve02(0.2,150)
curve02(0.1,95)
turtle.left(127)
turtle.forward(5)
curve01(2,20)
turtle.right(30)
turtle.forward(90)
turtle.right(7)
turtle.forward(75)
turtle.right(160)
turtle.forward(100)
curve02(0.1,105)
turtle.right(70)
curve01(0.2,200)
curve01(0.3,70)
turtle.left(175)
curve02(0.2,150)
curve02(0.3,150)
turtle.forward(20)
turtle.left(65)
curve01(0.1,120)
curve01(0.010,105)
turtle.right(10)
curve01(0.2,110)
turtle.right(60)
curve01(0.3,138)
turtle.right(30)
curve01(0.2,160)
turtle.left(150)
curve02(0.2,100)
curve02(0.1,150)
turtle.forward(70)
curve02(0.4,40)
turtle.left(160)
curve01(0.1,60)
turtle.left(7)
curve01(0.1,120)
curve01(0.2,30)
turtle.forward(20)
turtle.right(140)
curve02(0.2,40)
turtle.right(50)
curve02(0.2,70)
turtle.right(8)
curve02(0.1,70)
curve02(0.5,50)
turtle.left(153)
curve01(0.1,170)
turtle.right(81)
curve02(0.2,20)
turtle.right(3)
curve02(0.1,62)
turtle.right(153) #..
curve01(0.1,63)
turtle.left(50)
curve02(0.1,175)
turtle.left(60)
turtle.forward(7)
turtle.end_fill()
#going to replicate
turtle.left(92.15)
turtle.penup()
turtle.forward(417)
turtle.pendown()
turtle.fillcolor('red')
turtle.begin_fill()
#right face
turtle.right(90)
curve02(5,20)
turtle.right(175)
turtle.forward(50)
turtle.right(25)
turtle.forward(28)
turtle.left(160)
turtle.forward(170)
curve01(0.2,65)
turtle.left(60)
curve02(0.1,140)
curve02(0.5,50)
turtle.right(180)
curve01(0.2,150)
curve01(0.1,95)
turtle.right(127)
turtle.forward(5)
curve02(2,20)
turtle.left(30)
turtle.forward(90)
turtle.left(7)
turtle.forward(75)
turtle.left(160)
turtle.forward(100)
curve01(0.1,105)
turtle.left(70)
curve02(0.2,200)
curve02(0.3,70)
turtle.right(175)
curve01(0.2,150)
curve01(0.3,150)
turtle.forward(20)
turtle.right(65)
curve02(0.1,120)
curve02(0.010,105)
turtle.left(10)
curve02(0.2,110)
turtle.left(60)
curve02(0.3,138)
turtle.left(30)
curve02(0.2,160)
turtle.right(150)
curve01(0.2,100)
curve01(0.1,150)
turtle.forward(70)
curve01(0.4,40)
turtle.right(160)
curve02(0.1,60)
turtle.right(7)
curve02(0.1,120)
curve02(0.2,30)
turtle.forward(20)
turtle.left(140)
curve01(0.2,40)
turtle.left(50)
curve01(0.2,70)
turtle.left(8)
curve01(0.1,70)
curve01(0.5,50)
turtle.right(153)
curve02(0.1,170)
turtle.left(81)
curve01(0.2,20)
turtle.left(3)
curve01(0.1,62)
turtle.left(153) #..
curve02(0.1,63)
turtle.right(50)
curve01(0.1,100) #0.1
turtle.forward(75)
turtle.right(75)
turtle.forward(2)
turtle.end_fill()
turtle.done()
import turtle
turtle.bgcolor('black')
turtle.pencolor('red')
turtle.hideturtle()
turtle.speed()
#curve01
def curve01(a,d):
for i in range(d):
turtle.right(a)
turtle.forward(1)
#making eye
turtle.width(15)
turtle.penup()
turtle.right(90)
turtle.forward(85)
turtle.left(90)
turtle.forward(35)
turtle.pendown()
turtle.fillcolor('white')
turtle.begin_fill()
turtle.left(55)
curve01(0.09,100)
curve01(0.2,100)
turtle.forward(70)
turtle.right(90)
curve01(0.5,100)
curve01(00,30)
curve01(0.3,50)
curve01(0.6,50)
turtle.forward(50)
turtle.right(47)
curve01(0.1,95)
turtle.end_fill()
#changing
turtle.penup()
turtle.left(36)
turtle.forward(70)
turtle.pendown()
#curve02
def curve02(a,d):
for i in range(d):
turtle.left(a)
turtle.forward(1)
#second eye
turtle.fillcolor('white')
turtle.begin_fill()
turtle.right(55)
curve02(0.09,100)
curve02(0.2,100)
turtle.forward(70)
turtle.left(90)
curve02(0.5,100)
curve02(00,30)
curve02(0.3,50)
curve02(0.6,50)
turtle.forward(50)
turtle.left(47)
curve02(0.1,95)
turtle.end_fill()
turtle.penup()
turtle.width(0)
turtle.right(49)
turtle.forward(30)
turtle.left(102) #100.40
turtle.forward(145)
turtle.pencolor('red')
#making left face
turtle.fillcolor('red')
turtle.begin_fill()
turtle.speed()
turtle.pendown()
turtle.left(90)
curve01(5,20)
turtle.left(175)
turtle.forward(50)
turtle.left(25)
turtle.forward(28)
turtle.right(160)
turtle.forward(170)
curve02(0.2,65)
turtle.right(60)
curve01(0.1,140)
curve01(0.5,50)
turtle.left(180)
curve02(0.2,150)
curve02(0.1,95)
turtle.left(127)
turtle.forward(5)
curve01(2,20)
turtle.right(30)
turtle.forward(90)
turtle.right(7)
turtle.forward(75)
turtle.right(160)
turtle.forward(100)
curve02(0.1,105)
turtle.right(70)
curve01(0.2,200)
curve01(0.3,70)
turtle.left(175)
curve02(0.2,150)
curve02(0.3,150)
turtle.forward(20)
turtle.left(65)
curve01(0.1,120)
curve01(0.010,105)
turtle.right(10)
curve01(0.2,110)
turtle.right(60)
curve01(0.3,138)
turtle.right(30)
curve01(0.2,160)
turtle.left(150)
curve02(0.2,100)
curve02(0.1,150)
turtle.forward(70)
curve02(0.4,40)
turtle.left(160)
curve01(0.1,60)
turtle.left(7)
curve01(0.1,120)
curve01(0.2,30)
turtle.forward(20)
turtle.right(140)
curve02(0.2,40)
turtle.right(50)
curve02(0.2,70)
turtle.right(8)
curve02(0.1,70)
curve02(0.5,50)
turtle.left(153)
curve01(0.1,170)
turtle.right(81)
curve02(0.2,20)
turtle.right(3)
curve02(0.1,62)
turtle.right(153) #..
curve01(0.1,63)
turtle.left(50)
curve02(0.1,175)
turtle.left(60)
turtle.forward(7)
turtle.end_fill()
#going to replicate
turtle.left(92.15)
turtle.penup()
turtle.forward(417)
turtle.pendown()
turtle.fillcolor('red')
turtle.begin_fill()
#right face
turtle.right(90)
curve02(5,20)
turtle.right(175)
turtle.forward(50)
turtle.right(25)
turtle.forward(28)
turtle.left(160)
turtle.forward(170)
curve01(0.2,65)
turtle.left(60)
curve02(0.1,140)
curve02(0.5,50)
turtle.right(180)
curve01(0.2,150)
curve01(0.1,95)
turtle.right(127)
turtle.forward(5)
curve02(2,20)
turtle.left(30)
turtle.forward(90)
turtle.left(7)
turtle.forward(75)
turtle.left(160)
turtle.forward(100)
curve01(0.1,105)
turtle.left(70)
curve02(0.2,200)
curve02(0.3,70)
turtle.right(175)
curve01(0.2,150)
curve01(0.3,150)
turtle.forward(20)
turtle.right(65)
curve02(0.1,120)
curve02(0.010,105)
turtle.left(10)
curve02(0.2,110)
turtle.left(60)
curve02(0.3,138)
turtle.left(30)
curve02(0.2,160)
turtle.right(150)
curve01(0.2,100)
curve01(0.1,150)
turtle.forward(70)
curve01(0.4,40)
turtle.right(160)
curve02(0.1,60)
turtle.right(7)
curve02(0.1,120)
curve02(0.2,30)
turtle.forward(20)
turtle.left(140)
curve01(0.2,40)
turtle.left(50)
curve01(0.2,70)
turtle.left(8)
curve01(0.1,70)
curve01(0.5,50)
turtle.right(153)
curve02(0.1,170)
turtle.left(81)
curve01(0.2,20)
turtle.left(3)
curve01(0.1,62)
turtle.left(153) #..
curve02(0.1,63)
turtle.right(50)
curve01(0.1,100) #0.1
turtle.forward(75)
turtle.right(75)
turtle.forward(2)
turtle.end_fill()
turtle.done()
What do we use to define a block of
code in Python Programming
language?
code in Python Programming
language?
Anonymous Quiz
22%
Brackets
21%
Curly braces
57%
Indentation
Top Programming Interview Questions and Answers (General)
Question: Please explain what you understand by computer programming.
Answer: Also known as coding or programming, computer programming is the process of encoding an algorithm into a notation, typically a computer program, by means of some programming language so that it can be executed by a computer.
Each programming language contains a set of instructions for the computer to execute a set of tasks. Programming is a complex process that includes designing an algorithm, coding the same in a programming language, debugging a program, maintaining, and updating the code.
Question: Can you enumerate and explain the various types of errors that can occur during the execution of a computer program?
Answer: Three types of errors can occur during the execution of a computer program. These are:
Logical errors β This occurs in the scenario of a computer program implementing the wrong logic. As there is no report generated for these types of programming errors, they are the most difficult ones to deal with.
Runtime errors β Occurs when the program contains an illegal operation. For example, dividing a number by 0. These are the only errors that are displayed instantly during the program execution. Upon the occurrence of a runtime error, the program execution is stopped and a diagnostic message is displayed.
Syntax errors β Occurs when one or more grammatical rules of the programming language being used is violated. Such errors are detected during compile time.
Question: Please explain an algorithm. What are some of its important features?
Answer: An algorithm can be defined as a set of finite steps that when followed helps in accomplishing a particular task. Important features of an algorithm are clarity, efficiency, and finiteness.
Question: What do you understand by maintaining and updating a computer program?
Answer: The maintenance and updating process of a computer program starts post its successful installation. While program maintenance is the continuous process of monitoring the computer program for bugs and errors, updating the computer program means making it better with minor and major changes over time.
Question: Please provide a brief explanation on variables.
Answer: Variables are used for storing the input of a program as well as the computational results during program execution. These are actually named memory locations. The value stored in a variable can change during the program execution.
Question: Please explain what you understand by computer programming.
Answer: Also known as coding or programming, computer programming is the process of encoding an algorithm into a notation, typically a computer program, by means of some programming language so that it can be executed by a computer.
Each programming language contains a set of instructions for the computer to execute a set of tasks. Programming is a complex process that includes designing an algorithm, coding the same in a programming language, debugging a program, maintaining, and updating the code.
Question: Can you enumerate and explain the various types of errors that can occur during the execution of a computer program?
Answer: Three types of errors can occur during the execution of a computer program. These are:
Logical errors β This occurs in the scenario of a computer program implementing the wrong logic. As there is no report generated for these types of programming errors, they are the most difficult ones to deal with.
Runtime errors β Occurs when the program contains an illegal operation. For example, dividing a number by 0. These are the only errors that are displayed instantly during the program execution. Upon the occurrence of a runtime error, the program execution is stopped and a diagnostic message is displayed.
Syntax errors β Occurs when one or more grammatical rules of the programming language being used is violated. Such errors are detected during compile time.
Question: Please explain an algorithm. What are some of its important features?
Answer: An algorithm can be defined as a set of finite steps that when followed helps in accomplishing a particular task. Important features of an algorithm are clarity, efficiency, and finiteness.
Question: What do you understand by maintaining and updating a computer program?
Answer: The maintenance and updating process of a computer program starts post its successful installation. While program maintenance is the continuous process of monitoring the computer program for bugs and errors, updating the computer program means making it better with minor and major changes over time.
Question: Please provide a brief explanation on variables.
Answer: Variables are used for storing the input of a program as well as the computational results during program execution. These are actually named memory locations. The value stored in a variable can change during the program execution.
This media is not supported in your browser
VIEW IN TELEGRAM
Bring back childhood memoriesπ. Tertis game using python. Source code ππ
All keywords in Python are in
Anonymous Quiz
12%
Capitalized
54%
lower case
7%
UPPER CASE
27%
None of the mentioned
Which of the following character is
used to give single-line comments in
Python?
used to give single-line comments in
Python?
Anonymous Quiz
20%
//
67%
#
3%
!
10%
/*
import turtle
a=turtle.Turtle()
a.getscreen().bgcolor("black")
a.penup()
a.goto(-200, 100)
a.pendown()
a.color("yellow")
a.speed(25)
def star(turtle, size):
if size<=10:
return
else:
turtle.begin_fill()
for i in range (5):
turtle.pensize(2)
turtle.forward(size)
star(turtle, size/3)
turtle.left(216)
turtle.end_fill()
star(a, 360)
turtle.done()
a=turtle.Turtle()
a.getscreen().bgcolor("black")
a.penup()
a.goto(-200, 100)
a.pendown()
a.color("yellow")
a.speed(25)
def star(turtle, size):
if size<=10:
return
else:
turtle.begin_fill()
for i in range (5):
turtle.pensize(2)
turtle.forward(size)
star(turtle, size/3)
turtle.left(216)
turtle.end_fill()
star(a, 360)
turtle.done()