# data[].attributes.headline
Jia Han skibidi ohio sigma alpha rizzler

# data[].attributes.subject
Jia Han skibidi ohio sigma alpha rizzler

# data[].attributes.body
import turtle

from math import cos,sin

from time import sleep

window = turtle.Screen()

mySpirograph = turtle.Turtle()

mySpirograph.hideturtle()

mySpirograph.pensize(1)

myPen = turtle.Turtle()

myPen.hideturtle()

myPen.tracer(0)

myPen.pensize(2)

myPen.penup()

myPen.color('skyblue')

R = 150

r = 60

d = 80

angle = 0

while True:

mySpirograph.clear()

mySpirograph.penup()

mySpirograph.color('blue')

#Draw the big circle

# 1. move to the starting point of circle here

mySpirograph.goto(0, -R)

# 2. put the pen down

mySpirograph.pendown()

# 3. code to draw circle with radius R

mySpirograph.circle(R)

#create the small circle

angle = angle + 0.1

#x coord of red circle center:

redcircle_x = (R - r) * cos(angle)

#y coord of red circle center:

redcircle_y = (R - r) * sin(angle)

mySpirograph.penup()

mySpirograph.color('red')

#Draw the small circle

# 1. Move the turtle to the correct x,y coordinates

# before drawing the circle

mySpirograph.goto(redcircle_x, redcircle_y - r)

# 2. Put the pen down

mySpirograph.pendown()

# 3. Draw the circle with radius r

mySpirograph.circle(r)

# Create the spirograph pattern:

# 1. Calc the x and y coordinates for the hypotrochoid

x = redcircle_x + d cos(((R-r)/r)angle)

y = redcircle_y - d sin(((R-r)/r)angle)

# 2. Move the turtle to the center of the red circle

# WITHOUT drawing a line

mySpirograph.penup()

mySpirograph.goto(redcircle_x, redcircle_y)

# 3. Move the turtle to the hypotrochoid coordinates

# WHILE drawing a line

mySpirograph.pendown()

mySpirograph.goto(x,y)

# 4. Tell the myPen turtle to move to the location of

# mySpirograph and put the pen down

myPen.goto(mySpirograph.pos())

myPen.pendown()

sleep(0.25)

mySpirograph.getscreen().update()

# data[].attributes.body
import turtle

from math import cos,sin

from time import sleep

window = turtle.Screen()

mySpirograph = turtle.Turtle()

mySpirograph.hideturtle()

mySpirograph.pensize(1)

myPen = turtle.Turtle()

myPen.hideturtle()

myPen.tracer(0)

myPen.pensize(2)

myPen.penup()

myPen.color('skyblue')

R = 150

r = 60

d = 80

angle = 0

while True:

mySpirograph.clear()

mySpirograph.penup()

mySpirograph.color('blue')

#Draw the big circle

# 1. move to the starting point of circle here

mySpirograph.goto(0, -R)

# 2. put the pen down

mySpirograph.pendown()

# 3. code to draw circle with radius R

mySpirograph.circle(R)

#create the small circle

angle = angle + 0.1

#x coord of red circle center:

redcircle_x = (R - r) * cos(angle)

#y coord of red circle center:

redcircle_y = (R - r) * sin(angle)

mySpirograph.penup()

mySpirograph.color('red')

#Draw the small circle

# 1. Move the turtle to the correct x,y coordinates

# before drawing the circle

mySpirograph.goto(redcircle_x, redcircle_y - r)

# 2. Put the pen down

mySpirograph.pendown()

# 3. Draw the circle with radius r

mySpirograph.circle(r)

#sleep(0.25)

mySpirograph.getscreen().update()

# data[].attributes.body
import turtle

from math import cos,sin

from time import sleep

window = turtle.Screen()

mySpirograph = turtle.Turtle()

mySpirograph.hideturtle()

mySpirograph.pensize(1)

myPen = turtle.Turtle()

myPen.hideturtle()

myPen.tracer(0)

myPen.pensize(2)

myPen.penup()

myPen.color('skyblue')

R = 150

r = 60

d = 80

angle = 0

while True:

mySpirograph.clear()

mySpirograph.penup()

mySpirograph.color('blue')

#Draw the big circle

# 1. set starting point of circle here

# 2. start drawing

# 3. code to draw circle with radius R

mySpirograph.getscreen().update()

# data[].attributes.headline
Example Ulam Spiral Code (paste at the end of your Sieve of Eratosthenes code)

# data[].attributes.subject
Example Ulam Spiral Code (paste at the end of your Sieve of Eratosthenes code)

# data[].attributes.body
import turtle

mike = turtle.Turtle()

mike.speed(0)

side = 0.1

dist = 0.1

mike.penup()

for i in range(limit):

mike.forward(side)

dist = dist + 0.1

if dist > side:

mike.right(90)

side = side + 0.1

dist = 0.1

if numbers_list[i]:

mike.dot(3)

# data[].attributes.body
limit = int(input("Find prime numbers up to what number?"))

numbers_list = [True for i in range(limit+1)]

# set numbers 0 and 1 to False because they're not primes

numbers_list[0] = False

numbers_list[1] = False

# start looping through the rest of the list checking for primes

i = 2

while i < limit + 1:

#test to see if list item is True

if numbers_list[i] == True:

#If it is, print out message that we found a prime

print(str(i) + " is a prime number!")

#and also loop through and set multiple to False

for multiple in range(i*2, limit+1, i):

numbers_list[multiple] = False

i += 1 # i = i + 1

# data[].attributes.body
scores = [71.5, 97, 34.5, 60, 88, 75, 66, 93.5, 95, 82]

def gradeClassification(score):

if score >= 90:

return "A"

elif score >= 80:

return "B"

elif score >= 70:

return "C"

elif score >= 60:

return "D"

else:

return "F"

#create a list with values using the gradeClassification function

# for every score in the list scores

print([gradeClassification(score) for score in scores])

# data[].attributes.body
names = ["Alice", "bob", "Charlene", "DAVID", "Eleanor"]

#Use list comprehension to make all the names lowercase

print([i.lower() for i in names])

print([i.upper() for i in names])

print([i+i for i in names])

# data[].attributes.body
#Option 1

myList = []

for i in range(100):

if i % 7 == 0:

myList.append(i)

print(myList)

#Option 2

print([i for i in range(100) if i % 7 == 0])

# data[].attributes.body
10 - The value of pi is: 2.8

100 - The value of pi is: 3.32

1000 - The value of pi is: 3.136

10000 - The value of pi is: 3.1388

the value of pi is typically 3.142( the 100 is the most accurate )

# data[].attributes.body
100 = 3.024

5000 = 3.096

# data[].attributes.body
no.dots pi est how far off % off

10 - 3.2 0.06 6%

100 - 3.04 0.1 10%

1000 - 3.16 0.02 2%

10000- 3.1368 0.0032 0.32%

# data[].attributes.headline
legends says that this is still going(jiafu)

# data[].attributes.subject
legends says that this is still going(jiafu)

# data[].attributes.headline
jiafu has invited you  to play rock paper scissors

# data[].attributes.subject
jiafu has invited you  to play rock paper scissors

# data[].attributes.body
True

False

True

False

False

# data[].attributes.body
1.true

2.false

3.true

4.false

5.false

# data[].attributes.body
true

false

true

false

false

# data[].attributes.headline
jiafu accident which end up looking cool

# data[].attributes.subject
jiafu accident which end up looking cool