Python code for olympic rings :
import turtle
class MyTurtleOly(turtle.Turtle):
""""""
def __init__(self):
""" Constructor"""
turtle.Turtle.__init__(self, shape="turtle")
def drawCircle(self, x, y, radius=50):
"""
Moves the turtle to draw a circle
"""
self.penup()
self.setposition(x, y)
self.pendown()
self.circle(radius)
def drawOlympicSymbol(self):
"""
Iterates to draw the Olympics logo
"""
positions = [(0, 0), (-120, 0), (60,60),
(-60, 60), (-180, 60)]
for position in positions:
self.drawCircle(position[0], position[1])
if __name__ == "__main__":
t = MyTurtleOly()
t.drawOlympicSymbol()
turtle.getscreen()._root.mainloop()
Python code for star :
import turtle
def drawStar(size, color):
angle = 120
turtle.fillcolor(color)
turtle.begin_fill()
for side in range(5):
turtle.forward(size)
turtle.right(angle)
turtle.forward(size)
turtle.right(72 - angle)
turtle.end_fill()
return
drawStar(100, "purple")
Please help with 3.12 and 3.14 Write a program that prompts the user to enter the...
Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * * * * * * * **...
please solve using python
thank you!
Write a program which prompts the user to enter a number of rows, and prints a hollow square star pattern with 2 diagonals. Note: you can assume that the integer will always be > 1 and will be an odd number. For example: Input Result 5 Enter number of rows: 5 ***** ** ** * * * ** ** ***** 9 Enter number of rows: 9 ** ** ** * * * * *...
Write a program that prompts the user to enter the sides and their length of a regular polygon and display its area. ****Using c++
In c++ please .. Write a program that prompts the user to enter a four-digit integer and displays the number in reverse order.
Write a program that prompts the user to enter an integer, n , and then n floating point numbers. As the numbers are read, the program will calculate the average of the negative numbers. In C language.
Write a program that prompts the user to enter a length in feet and inches and outputs the equivalent length in centimeters. If the user enters a negative number or a nondigit number, throw and handle an appropriate exception and prompt the user to enter another set of numbers. Using Python
Python 3 **11.40 (Guess the capitals) Write a program that repeatedly prompts the user to enter a capital for a state. Upon receiving the user input, the program reports whether the answer is correct. Assume that 50 states and their capitals are stored in a two- dimensional list, as shown in Figure 11.13. The program prompts the user to answer all the states’ capitals and displays the total correct count. The user’s answer is not case sensitive. Implement the program...
Write a program that prompts the user to enter a question
(string) and display whether the
question is correct. It is correct if it ends with the
question mark (?)
----vyrovusmyzustning%20Class.pdf Programs with String Class Write a program that prompts the user to enter a question (string) and display whether the question is correct. It is correct if it ends with the question mark (?) Ask a question? Ask a question? How old are you What is your name? That's...
c++ with pseudocodes Write a program that prompts the user to enter exam marks. The program then displays the average mark, the highest mark and number of marks entered less than the average mark.
Please help C++ language Instructions Write a program that prompts the user to enter 50 integers and stores them in an array. The program then determines and outputs which numbers in the array are sum of two other array elements. If an array element is the sum of two other array elements, then for this array element, the program should output all such pairs.