code:
#spiral patterns using for loop and turtle and turtle used for
draw patterns.
#import turtle.
from turtle import *
setup(500,500) #make window of size 500*500 pixels
t1 = Turtle() # let make a tutrle to build graphics
t1.hideturtle() # intitally hide turtle
for i in range(10,110,5): # loop from point 10 pixel and step size
5 upto 110 pixels
t1.forward(i) # move forward i pixels
t1.left(90) # move counter clockwise of 90 degree for square 90
degrees
screenshot:
if you want color then code is:
#spiral patterns using for loop and turtle and turtle used for
draw patterns.
#import turtle.
from turtle import *
setup(500,500) #make window of size 500*500 pixels
t1 = Turtle() # let make a tutrle to build graphics
t1.hideturtle() # intitally hide turtle
t1.color("blue") #for color blue
for i in range(10,110,5): # loop from point 10 pixel and step size
5 upto 110 pixels
t1.forward(i) # move forward i pixels
t1.left(90) # move counter clockwise of 90 degree for square 90
degrees
output:
(ON PYTHON IDLE 3.7.2) Write a code to draw the following pattern: Write a code to draw the following pattern:
With the use of python IDLE version 3.7.2, use the while loop that iterates 100,000 times. In the loop code, roll a pair of dice by generating(and summing) two random numbers in the range 1 through 6. Report to the user how many data points have been generated (i.e how many times the dice have been rolled), as in: successfully simulated 100,000 dice rolls. Create a histogram of the dice rolls showing how many times a 2 was rolled, how...
Python 3.7.2 for language Please comment for each line of code good naming is important 1. Answer the question: what is the Python regular expression pattern that would match a hex color (https://en.wikipedia.org/wiki/Web_colors ) (for example, the pattern that would match an email address is '[\w.-]+@[\w.-]') Write an algorithm for step 3. As part of your algorithm, be sure to describe the pattern you're using to find the win/loss result for each game. Write a program that looks at the...
Using Python 3.5.2 and IDLE Write the code for a modified game of the card game crazy eights (much like a game of UNO, where the card played is now on top of the deck and its number or face value is now what is playable for the next player). Write the code to be a 2 player game with any 8 card being able to input a new face value to play on the discard pile. Rules: Use a...
write in python idle Write a full python program that asks the user to type in 10 words using a loop, prompting the user for each word with a number. The program then displays the longest word and the shortest word the user typed in.
python Write a Python program to construct the following pattern, using a nested for loop. * * * * * * * * * * * * * * * * * * * * * * * * * * *
Write a simple Python code to draw a line (y=10x). The plot should have the following labels in the x-axis, y-axis, and a title.
USE IDLE PLATFORM FOR PYTHON PLEASE Write a Python program that creates a list that contains players of your favorite teams. The program then should ask the user to enter the name of a player. If the player is in your list, display a message indicating that the player is in the team. Otherwise, the program should display a message stating that the player isn't on the team.
Write a Python program (using python 3.7.2) that lets the user play the game of Rock, Paper, Scissors against the computer. The program should work as follows. 1. When the program begins, a random number in the range of 1 through 3 is generated. If the number is 1, then the computer has chosen rock. If the number is 2, then the computer has chosen paper. If the number is 3, then the computer has chosen scissors. (Don’t display the...
Programming Exercise 1. Show fully functioning code that can be pasted into a new Python IDLE file and function correctly. Show the output that would result from each of the following possible inputs: 3, 4, 5 a) wollot sd 3, 3, 3 b) c) 5, 4, 3 d) 3, 5, 2 oaeb e) 5, 4, 7 f) 3, 3, 2 Programming Exercises 1. Many companies pay time-and-a-half for any hours worked above 40 in a given week. Write a program...
I would like to uninstall the python version 3.7.2 that is installed on my computer and start everything from scratch. That version has been having trouble importing modules. Please, can you give me the steps and the best version of Python to be installed so that the compiler can import any type of module from the library when it compiles codes? Thanks!