Using Turtle we can create different geometrical shapes like squares, rectangles, triangles and so on.
The answer to your question would be:
from turtle import *
def= draw.triangle()
canvas= turtle.screen()
canvas.setup(600, 400)
bob= turtle.Turtle()
bob.forward(100)
bob.left(120)
bob.forward(100)
bob.left(120)
bob.forward(100)
canvas.exitonclick()
draw_triangle()
Use python to do this. Will rate and thanks Write a function to draw three heights for a acute ...
Write a function to draw three heights for a acute triangle via turtle. The input of the function are the coordinates of three vertexes. WRITE THE CODE IN PYTHON AND SHOW OUTPUT.
Write a python program that will create a histogram of the
number of times each character occurs in a file. Check
https://en.wikipedia.org/wiki/Histogram and
http://interactivepython.org/runestone/static/thinkcspy/Functions/ATurtleBarChart.html
for help. Your program will read any input text file and print the
histogram. If you have a huge file you should have a graph similar
to:
Note the y-axis shows the percentage of each
letter. The height of each bar is percentage of that
letter. Program MUST show the graph with percentage marks
on y-axis...
Write a function that draw your initials. (Using python 3 turtle) (H, Z)
Using python
Here is the code
import turtle
def draw_triangle(vertex, length, k):
'''
Draw a triangle at depth k given the bottom vertex.
vertex: a tuple (x,y) that gives the coordinates of the bottom
vertex.
When k=0, vertex is the left bottom vertex for the outside
triangle.
length: the length of the original outside triangle (the
biggest one).
k: the depth of the input triangle.
As k increases by 1, the triangles shrink to a smaller
size.
When k=0, the...
Please do not use any existing code, it would be amazing if you could code it yourself Can i get Playfair Cipher for python 3 that encrypts a message and decrypts a message or exits when prompted by the user, get input from user to encrypt. could you possibly make it as simple as you can without losing functionality. please include comments, that would help me better understand Example of PlayFair Cipher: https://en.wikipedia.org/wiki/Playfair_cipher
Use Python 3.7 to Write a function called volume_of_box() that takes three parameters (the length, width, and height of the box) and returns the volume of the box. Then, use that function in a program which prompts the user to enter the dimensions of a box and returns the volume. Your program should include input validation to ensure that the values entered are positive and should be able to accept float values. Many thanks for all your time and effort...
Use a function in python that uses turtle graphics to draw a circle. Allow inputs of where to start (x,y) the radius, the pen color and fill color.
In python use draw turtle to draw 2 different shapes that look visually appealing and here are the criteria: -Must have have a function and a for loop in that function -and also have a while loop outside the function that calls the function. -and also have the user be able to input how many of the shapes he want such as the example below num_of_rectangles_and_square = int(input('how many rectangles and squares would you like drawn?'))
In python 3
What you need to do? 1. 2. 3. Create a function implementing the logic to a Pascal triangle. (You can use any logic of your choice to generate the triangle) Read an integer input from the user, to determine the number of rows to be generated in a Pascal triangle. Call the function by passing the input as an argument to the function. Hint: You can use a list of lists to store the values of a...
1. Write a Python function that implements the following algorithm that computes the sum of the first n non-negative powers of 2: 20 + 21 + ... + 2n-1, where n ≥ 0: 1. Input n (assume n ≥ 0) 2. Set sum to 1 3. Set value to 2 4. Do the following n-1 times: a. Add value to sum b. Multiply value by 2 5. Output sum 2.Use turtle to draw two flags of two countries...