Can someone please help me with 6.8 Code Practice adhesive.

Answers

Answer 1

Answer:

I'm looking for this one too

Answer 2

Answer:

import simplegui

import random

# global constants

WIDTH = 600

HEIGHT = 400

PARTICLE_RADIUS = 5

COLOR_LIST = ["Red", "Green", "Blue", "White"]

DIRECTION_LIST = [[1,0], [0, 1], [-1, 0], [0, -1]]

# definition of Particle class

class Particle:

  # initializer for particles

  def __init__(self, position, color):

      self.position = position

      self.color = color

  # method that updates position of a particle    

  def move(self, offset):

      self.position[0] += offset[0]

      self.position[1] += offset[1]

  # draw method for particles

  def draw(self, canvas):

      canvas.draw_circle(self.position, PARTICLE_RADIUS, 1, self.color, self.color)

  # string method for particles

  def __str__(self):

      return "Particle with position = " + str(self.position) + " and color = " + self.color

# draw handler

def draw(canvas):

  for p in particle_list:

      p.move(random.choice(DIRECTION_LIST))

  for p in particle_list:

      p.draw(canvas)

# create frame and register draw handler

frame = simplegui.create_frame("Particle simulator", WIDTH, HEIGHT)

frame.set_draw_handler(draw)

# create a list of particles

particle_list = []

for i in range(100):

  p = Particle([WIDTH / 2, HEIGHT / 2], random.choice(COLOR_LIST))

  particle_list.append(p)

# start frame

frame.start()

Explanation:

this worked for me, sorry if its to late. let me know if anything is wrong


Related Questions

You wrote a program to allow the user to guess a number. Complete the code to get a number from the user.

# Get a guess from the user and update the number of guesses.

guess =

("Guess an integer from 1 to 10: ")

NEED HELP FAST

Answers

Answer:

import random

number = random.randrange(1, 10)

is_guess = 'y'

while is_guess == 'y':

   try:

       guess = int(input("Guess an integer number between 1 and 10: "))

       if guess < 1 or guess >10:

           print("You have exceeded the guessing range, try again")

           continue

       elif guess == number:

           print("Congrats! You guessed right.")

       else:

           print("Sorry, you guessed wrong")

   except ValueError:

       print("Your guess must be an integer number.")

   is_guess = input("Do you want to try again y/n ? ")

Explanation:

The random module of the python programming language is used to randomly select an integer value from a range of numbers. The guess variable value is a user input of an integer number.

If the guess variable is equal to the random number, then the program prints a congratulatory message. The program is no constant loop so long as the is_guess variable is equal to 'y'.

The try-except statement is used to detect the value error of the guess variable.

Answer:

input

Explanation:

For this exercise, we are going to take a look at an alternate Calculator class, but this one is broken. There are several scope issues in the calculator class that are preventing it from running. Your task is to fix the Calculator class so that it runs and prints out the correct results. The CalculatorTester is completed and should function correctly once you fix the Calculator class.
public class Calculator {
private int total;
private int value;
public Calculator(int startingValue){
int total = startingValue;
value = 0;
}
public int add(int value){
int total = total + value;
return total;
}
/**
* Adds the instance variable value to the total
*/
public int add(){
int total += value;
return total;
}
public int multiple(int value){
int total *= value;
return total;
}
public void setValue(int value){
value = value;
}
public int getValue(){
return value;
}
}

Answers

Answer:

public class Calculator {

   private int total;

   private int value;

   

   public Calculator(int startingValue){

       // no need to create a new total variable here, we need to set to the our instance total variable

       total = startingValue;

       value = 0;

   }

   public int add(int value){

       //same here, no need to create a new total variable. We need to add the value to the instance total variable

       total = total + value;

       return total;

   }

   /**

   * Adds the instance variable value to the total

   */

   public int add(){

       // no need to create a new total variable. We need to add the value to the instance total variable

       total += value;

       return total;

   }

   public int multiple(int value){

       // no need to create a new total variable. We need to multiply the instance total variable by value.

       total *= value;

       return total;

   }

   //We need to specify which value refers to which variable. Otherwise, there will be confusion. Since you declare the parameter as value, you need to put this keyword before the instance variable so that it will be distinguishable by the compiler.

   public void setValue(int value){

       this.value = value;

   }

   public int getValue(){

       return value;

   }

}

Explanation:

I fixed the errors. You may see them as comments in the code

click it to paste the content of clipboard ​

Answers

Ctrl + V

It is used for paste function.

Analytical Engine was designed in​

Answers

Answer:

1838

Explanation:

Analytical Engine was designed in 1838. The designer is Charles Babbage, who was an English mathematician and widely known for his innovation in the engineering world. He is often considered to be the father of computers.

Following his inability to finish the creation of Difference Engine, Charles Babbage would later when ahead to conceived the Analytical Machine in 1834

He eventually finished the design of an Analytical Machine by 1838.

Answer:

Charles Babbage

Explanation:

Just did test

Please program this in Python.


Create a list of your favorite 4 movies. Print out the 0th element in the list. Now set the 0th element to be “Star Wars” and try printing it out again.

Answers

lst = ["Star Wars", "Movie 2", "Movie 3", "Movie 4"]

print(lst[0])

I wrote my code in python 3.8. Best of luck

Another technique that makes use of the colon slicing technique to directly refer to element places is list slicing. Use a blank value before the first colon to access the first element, then use len() with -1 as the input to access the last element.

What is the 0th element in the list?

The element of the current ArrayList object at the provided index is returned by the get() function of the ArrayList class, which accepts an integer indicating the index value.

As a result, if you supply 0 or list to this method, you can obtain the first element of the current ArrayList.

Use a for loop with range (0, N) to get the first N members of a list. Then, make a new empty list and append the elements of the source list to the new list within the for loop. Range(0, N) iterates in steps of 1 from 0 to N-1. N is not comprised.

Therefore,lst = ["Star Wars", "Movie 2", "Movie 3", "Movie 4"] print(lst[0]).

Learn more about element here:

https://brainly.com/question/19312961

#SPJ2

Write a Python function that takes a positive integer N and returns the factorial of N, i.e., N! The factorial of N, denoted N!, is the product of the integers from 1 to N. (1 Point)

Answers

Answer:

The python function is as follows:

def fact(N):

   factorial = 1

   for i in range(1,N+1):

       factorial = factorial * i

   return(factorial)

Explanation:

This line defines the function

def fact(N):

This line initializes the product of 1 to N to 1

   factorial = 1

This line iterates through 1 to N

   for i in range(1,N+1):

This line calculates the product of 1 to N i.e. factorial

       factorial = factorial * i

This line returns the factorial

   return(factorial)


Some commands listed in a menu cannot be selected.


True or False

Answers

True! Have a nice week

Answer:

Explanation:

it is true

Identify the symbol. please help!!

Answers

Explanation:

counter bore

Answer:

Diameter

Explanation:

On technical literature or drawings, it could be a symbol to mean diameter.

explain why it is important for you to understand and describe the basic internal and external components of a computer in the work place​

Answers

Answer:

you go to edit

Explanation:

There's a chupacabra that looks like a mixed alligator , gecko it looks' like that but if you try harming it will it eat you "look up chupacabra only don't try looking up if it eats meat because that thing is a legendary animal and barely haves answers and has been cured alot and lives in the folklore mostly like the woods" it looks scary and cool the same time but some people said it has been instinct but it isn't it is spanish "which is puerto rican" lives in the united states, and mexico.. ( does it eat meat ) hasn't been seen around but you'll see a picture of it..

Answers

Answer:

wait. is this even a question or is it just informing us?

Explanation:

either way it is cool

ANSWER ASAP PLEASE Question #4
Fill in the Blank
Fill in the blank to complete the sentence.
_____ is used to store and process data over the Internet using computers that are not located at tthe users site.

Answers

Answer:

A cookie.

Explanation:

Click the crown at the top of this answer if this helped ;)

Which HTML tag is used to add an ordered list to a web page?

Answers

Answer:

<ol> Defines an ordered list

Answer:

<ol>

Explanation:

What is a free and compatible alternative to the Microsoft Office Suite (word processing, spreadsheets, and calendars)?

WordPad
Open Office
Notepad
Lotus Notes

Answers

Answer:

Open Office

Explanation:

Open Office may be regarded as an open source productivity tool which allows users to enjoy the ability to create and edit documents similar to Microsoft Word, create spreadsheet files and documents similar to Microsoft excel and Presentation tool similar to Microsoft PowerPoint. With the open source category of open office, it means it is a free software whereby users can enjoy these tools without having to purchase any user license. The other tools in the option such as Notepad, Lotus note do not posses all these functionality.

. Write a short Python function that takes a sequence of integer values and determines if there is a distinct pair of numbers in the sequence whose product is odd. (1 Point)

Answers

Answer:

Explanation:

The following code is written in Python and like requested takes a function called odd_number that takes a list of integers as a parameter. It then loops through the list two times, each time calculating the product of the two numbers and returning Yes if the product is an odd number while also including the two numbers from the list that make that product. If there is no odd product in the list the function simply returns No

def odd_product(my_list):

   for num1 in range(len(my_list)):

       for num2 in range(len(my_list)):

           if num1 == num2:

               pass

           else:

               product = my_list.__getitem__(num1) * my_list.__getitem__(num2)

               if (product % 2) != 0:

                   return "Yes, " + str(my_list.__getitem__(num1)) + " and " + str(my_list.__getitem__(num2))

   return "No"

Other Questions
You might need:Find the zeros of the function. Enter the solutions from least to greatest.f(x) = (x + 2)2 16lesser r =greater x = 1. List the types of fronts found on this map Find 759 3. PLS I NEED HELP ITS EITHER HAS A REMAINDER OR NOT ALSO GIVE ME AN ANSWER PLS DIS DUE TODAY At the end of the 1800s the direct effect of more leisure time was thatA) boredom enveloped in cultureB) there was an increase in crimeC) popular culture began to growD) people took second jobs Throughout the mid-1700s, Great Britain started to tighten control over the colonies bypassing many tax and trade laws Identify and describe TWO of these laws. has DNA that tells the rest of the organelles what to do The sand pit for the long jump has a width of 3.65 meters and a length of 9.5 meters. The cheerleaders want to cover the pit with a sign cheering on their team. How many square meters of paper will the cheerleaders need to cover the sand pit? Write an exponential function for each set of points.(0 , 1024), (1,256), (2,64). (3 , 16) and (4 ,4) The cost of two pounds of cherries is$8.58. What is the unit rate that describes thecost per pound of cherries? Describe working conditions in the Triangle Shirtwaist Factory Alex has saved $30 and he earns $12 per hour. He wants to have at least $150 in his savings account. How many hours can he work? The Benton family uses up a 1/2 gallon jug of milk every 3 days. At what rate do they drink milk? What was the outcome of the constitutional convention? Solve for x, 3-5x=18 Which of the following rational numbers is equal to that? please help quickly How is a man"always a child" in the woods?Which sentence acts as a central idea and best supports this metaphor? Algebra 2Factoring PolynomialsFactor the polynomial completely.1. x3 - 2x2 24x ok i have been stuck on this most of my math class please help me.-u/3 = -45 Sonia has $2,400 a month to spend on clothing and food. The price of clothing is $60 and the price of food is $10. The clothing and food pairs in Sonia's choice set include ________ units of clothing and ________ units of food. A) 40; 100 B) 30; 140 C) 20; 120 D) 0; 400 1. Define nation, state and nation-state. What is the difference between them? 2. Before the modern state, how were political entities divided in Europe, Latin America, South America and Asia? 3. What led to the rise of the modern state? 4. What is a boundary? How does it generate conflict? 5. What are the advantages of large states? Small states? 6. What are the different types of physical boundaries? 7. What is colonization? Why did people want to colonize? Explain how the Scramble for Africa and colonization led to boundary disputes. 8. Why and how do states cooperate with one another? Give examples. 9. Explain how 18th Century imperialism in Africa led to a series of border disputes and separatist movements today among different cultural groups.