Code.org lesson 8 level 5

Answers

Answer 1

Answer:

and?

Explanation:


Related Questions

PLEASE HELP ME FIX THIS CODE.

I WANT IT TO HAVE USER INPUT TO CHANGE AND IMAGE FILTER TO BLUE RED OR GREEN.


user_color = input("What color would you like to paint the canvas, blue, red or green?:")



def user_red(pixel):
pixel[0] = 100 + pixel[0]
pixel[1] = 100 - pixel[1]
pixel[2] = 100 - pixel[2]

return pixel

def user_green(pixel):
pixel[0] = 100 + pixel[0]
pixel[1] = 100 - pixel[1]
pixel[2] = 100 - pixel[2]

return pixel

def user_blue(pixel):
pixel[0] = 100 + pixel[0]
pixel[1] = 100 - pixel[1]
pixel[2] = 100 - pixel[2]

return pixel


def custom_filter(image, user_color):
for x in range(image.get_width()):
for y in range(image.get_height()):
pixel = image.get_pixel(x,y)
new_colors = invert_pixel(pixel)
image.set_red(x, y, new_colors[0])
image.set_green(x, y, new_colors[1])
image.set_blue(x, y, new_colors[2])



return image


def change_image():
global image
image = custom_filter(image, user_color)



timer.set_timeout(change_image, IMAGE_LOAD_TIME)

Answers

PLEASE HELP ME FIX THIS CODE.

I WANT IT TO HAVE USER INPUT TO CHANGE AND IMAGE FILTER TO BLUE RED OR GREEN.

user_color = input("What color would you like to paint the canvas, blue, red or green?:")

def user_red(pixel):

pixel[0] = 100 + pixel[0]

pixel[1] = 100 - pixel[1]

pixel[2] = 100 - pixel[2]

return pixel

def user_green(pixel):

pixel[0] = 100 + pixel[0]

pixel[1] = 100 - pixel[1]

pixel[2] = 100 - pixel[2]

return pixel

def user_blue(pixel):

pixel[0] = 100 + pixel[0]

pixel[1] = 100 - pixel[1]

pixel[2] = 100 - pixel[2]

return pixel

def custom_filter(image, user_color):

for x in range(image.get_width()):

for y in range(image.get_height()):

pixel = image.get_pixel(x,y)

new_colors = invert_pixel(pixel)

image.set_red(x, y, new_colors[0])

image.set_green(x, y, new_colors[1])

image.set_blue(x, y, new_colors[2])

return image

def change_image():

global image

image = custom_filter(image, user_color)

timer.set_timeout(change_image, IMAGE_LOAD_TIME)

explain three main steps in mail merging (6 marks) ​

Answers

Answer:

Explanation:

The mail merging process generally requires the following steps:

Creating a Main Document and the Template.

Creating a Data Source.

Defining the Merge Fields in the main document.

Merging the Data with the main document.

Saving/Exporting.

Rick is a fan of logic-based games. However, he is bored of the classic ones, like Sudoku and Mastermind, since he has solved so many of them. Recently he found a new game in which one is given a string with some question marks in it. The objective is to replace all of the question marks with letters (one letter per question mark) in such a way that no letter appears next to another letter of the same kind.
Write a function:
def solution(riddle)
that, given a string riddle, returns a copy of the string with all of the question marks replaced by lowercase letters (a-z) in such a way that the same letters do not occur next to each other. The result can be any of the possible answers as long as it fulfils the above requirements.
Examples:
1. Given riddle = "ab?ac?", your function might return "abcaca". Some other possible results are 'abzacd", "abfacf".
2. Given riddle = "rd?e?wg??", your function might return "rdveawgab".
3. Given riddle = "????????", your function might return "codility".
Write an efficient algorithm for the following assumptions:
• the length of the string is within the range [1..100,000);
• string riddle consists only of lowercases letters (a - z) or '?';
• it is always possible to turn string 'riddle' into a string without two identical consecutive letters.
1 # you can write to stdout for debugging purposes, e.g.
2 # print("this is a debug message")
3
4 def solution (riddle):
5
6 # write your code in Python 3.6
7 pass

Answers

Answer:

The function is as follows:

import random

import string

def solution(riddle):

   s = list(riddle)

   for i in range(len(riddle)):

       alpha = "".join(random.choice(string.ascii_letters) for x in range(1))

       alpha = alpha.lower()

       if s[i] == '?':

           if i > 0 and i < len(s)-1:

               if s[i+1] != alpha:

                   s[i] = alpha

               elif s[i-1] != alpha:

                   s[i] = alpha

               else:

                   i=i

           else:

               if i == 0:

                   if s[1] != alpha:

                       s[i] = alpha

                   else:

                       i = i

               else:

                   if s[i-1] != alpha:

                       s[i] = alpha

                   else:

                       i = i

   riddle = ""

   for ele in s:

       riddle+=ele

   

   return riddle

Explanation:

See attachment for explanation where comments are used to explain some lines

In this exercise we have to use the knowledge of the python language to write the code, so we have to:

The code is in the attached photo.

So to make it easier the code can be found at:

import random

import string

def solution(riddle):

  s = list(riddle)

  for i in range(len(riddle)):

      alpha = "".join(random.choice(string.ascii_letters) for x in range(1))

      alpha = alpha.lower()

      if s[i] == '?':

          if i > 0 and i < len(s)-1:

              if s[i+1] != alpha:

                  s[i] = alpha

              elif s[i-1] != alpha:

                  s[i] = alpha

              else:

                  i=i

          else:

              if i == 0:

                  if s[1] != alpha:

                      s[i] = alpha

                  else:

                      i = i

              else:

                  if s[i-1] != alpha:

                      s[i] = alpha

                  else:

                      i = i

  riddle = ""

  for ele in s:

      riddle+=ele

  return riddle

See more about python at brainly.com/question/26104476

who would benefit from using self-driving cars

Answers

Answer:

self independent

no need to depend on others

Answer:

Door dash employee's/Uber eat employees

would benefit from this

cmo se puede añadir amigo ??'

Answers

Answer:ok

Explanation:

Fill in the blanks using A to J below.

1. ----- = command driven

2. ----- = general purpose

3. ----- = custom written

4. ----- = icon

5. ----- = menu driven

6. ----- = integrated software

7. ----- = desktop

8. ----- = system software

9. ----- = Window

10. ----- = software house

A. Software written to meet the specific needs of a company.

B. Related specialized programs combined in a unified package.

C. This software can be adapted for specific needs but is not written for any specific business purpose.

D. This interface requires the user to type in codes or words.

E. A pictorial representation of a file, folder, program, task or procedure.

F. This interface allows you to move a mouse or cursor to make a selection.

G. A rectangle that displays information on the screen.

H. A visual background over which all your work is done.

I. This software notifies the computer to begin sending data to the appropriate program to get a document printed.

J. A company that specializes in writing software.

Answers

Answer:

A.software written to meet specific needs of company

B.Related specialized programs combined in a unified package

the first page of a website is what?​

Answers

Answer:

index.html

Explanation:

The name of the html file for the homepage of a website is usually "index.html"

Landing page or Home page

Which of the following best explains how an analog audio signal is typically represented by a computer?
a. An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits.
b. An analog audio signal is measured as a sequence of operations that describe how the sound can be reproduced. The operations are represented at the lowest level as programming instructions.
c. An analog audio signal is measured as input parameters to a program or procedure. The inputs are represented at the lowest level as a collection of variables.
d. An analog audio signal is measured as text that describes the attributes of the sound. The text is represented at the lowest level as a string.

Answers

Answer:

A. An analog audio signal is measured at regular intervals. Each measurement is stored as a sample, which is represented at the lowest level as a sequence of bits.

Explanation:

I took the test

A security team has downloaded a public database of the largest collection of password dumps on the Internet. This collection contains the cleartext credentials of every major breach for the last four years. The security team pulls and compares users' credentials to the database and discovers that more than 30% of the users were still using passwords discovered in this list. Which of the following would be the BEST combination to reduce the risks discovered?

a. Password length, password encryption, password complexity
b. Password complexity least privilege, password reuse
c. Password reuse, password complexity, password expiration
d. Group policy, password history, password encryption

Answers

Answer:

a. Password length, password encryption, password complexity

Explanation:

Under this scenario, the best combination would be Password length, password encryption, password complexity. This is because the main security problem is with the user's passwords. Increasing the password length and password complexity makes it nearly impossible for individuals to simply guess the password and gain access, while also making it extremely difficult and time consuming for hackers to use software to discover the password as well. Password excryption would be an extra layer of security as it encrypts the password before storing it into the database, therefore preventing eavesdroppers from seeing the password and leaked info from being used without decryption.


Explain working principle of computer.​

Answers

Explanation:

The working principle of the computer system. Computers do the work primarily in the machine and we can not see, a control center that converts the information data input to output. This control center, called the central processing unit (CPU), How Computers Work is a very complex system.

hope it is helpful to you

Create a PetStore class, a Dog class, and Cat class. Once instantiated, a PetStore should be able to take in and give out pets. The store's method for receiving pets should be called receive. This method should take a single pet object (either a Dog or Cat instance) and should add it to the store's inventory of pets. The store's method for giving out a pet should be called sell and can take no arguments. The method returns a pet when called.

Answers

Answer:

thanks to the great place

Explanation:

hottest year in hindi history and happiness and the world is not a big deal to me because I think it's a good thing for a woman who has been a good friend of yours and happiness and be happy with examples

When dragging a sheet tab to move it, the location of the _______ determines where the sheet tab will be moved.

square
line
arrow
last tab

Answers

the location of the arrow determines it

What is the main fuction of command interpreter​

Answers

The command interpreter or the command-line interface is one of the ways a user can interface with the operating system. The command interpreter's main task is to understands and executes commands which it turns into system calls. The kernel is the central module of an OS.

_________________

Brainliest would be greatly appreciated!

I found this!

_________________

#SpreadTheLove

#SaveTheTrees

- Mitsu JK

Apart from the OOPs concepts learned in this lesson, identify additional concepts and write an essay on their functions. Explain how they are used in a program.
PLSSSS HELLP MEEE ASAP!!!!​

Answers

Explanation:

Object Oriented Programming (OOPS or OOPS for Object Oriented Programming System) is the most widely used programming paradigm today. While most of the popular programming languages are multi-paradigm, the support to object-oriented programming is fundamental for large projects. Of course OOP has its share of critics. Nowadays functional programming seems the new trendy approach. Still, criticism is due mostly to misuse of OOP.

La herramienta …………………………... en el programa CorelDraw X8, está conformado por texto artístico.

Answers

Answer

what are you talking about, thats crazy!

Explanation:

no seriasly, what are you taking about

what is the best plugin for subscription sites?

Answers

Answer:

Explanation:

MemberPress. MemberPress is a popular & well-supported membership plugin. ...

Restrict Content Pro. ...

Paid Memberships Pro. ...

Paid Member Subscriptions. ...

MemberMouse. ...

iThemes Exchange Membership Add-on. ...

Magic Members. ...

s2Member.

Python program
You are given the following text file called Mytext.txt. Write a Python function called search_file that accepts the name of the file (i.e. filename) and a string to look for in the file (i.e. mystring) as parameters. The function then looks for mystring in the file. Whenever it finds the string in a line, it saves the line number and the text for that line in a dictionary. Finally, it returns the dictionary after reading all the lines in the file and populating the dictionary with all matching line numbers and line text. If an empty string or a blank string is passed as mystring then an empty dictionary is returned.
Sample Input: search_file("Mytext.txt","python")
Sample Input: search_file("Mytext.txt","")
Contents of Mytext.txt
Python is an interpreted, high-level, programming language.
Python is dynamically typed and garbage-collected.
Python was conceived in the late 1980s.
Python 2.0, was released in 2000.
Python 3.0, was released in 2008.
The interpreters are available for many operating systems.

Answers

Answer:

The function in Python is as follows:

def search_file(filename,mystring):

my_dict = {}

count = 0

file = open(filename)

lines = file.readlines()

for line in lines:

 count+=1

 if mystring.lower() in line.lower():

  my_dict[count] = line.rstrip('\n')

return my_dict

Explanation:

This defines the function

def search_file(filename,mystring):

This initializes an empty dictionary

my_dict = {}

This initializes the number of lines to 0

count = 0

This opens the file

file = open(filename)

This reads the lines of the file

lines = file.readlines()

This iterates through the lines

for line in lines:

This increments the number line

 count+=1

This checks if the string exists in the line

 if mystring.lower() in line.lower():

If yes, the line number and the string are added to the dictionary

  my_dict[count] = line.rstrip('\n')

This returns the dictionary

return my_dict

Crop-Harvesting robots manage harvest automation, seeding, and weeding.
True
False

Answers

Answer: False

Explanation: I think there are specific robots for seeding, weeding and harvest automation. Unless its a multi purposed crop-harvesting robot I would assume it would only be related to harvesting tasks. (picking)

More info here: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC7273211/

short note about micro miniaturzation​

Answers

Answer:

the manufacture of extremely small versions of electronic devices.

Explanation:

asks

mxskssssksskwlwslskamzmzmsmsmz

∉∉∉⊆αβ∞∞the life of me

Answers

Answer:

?

Explanation:

I honestly agree to this statement
So poetic

List the types of infrared we have

Answers

Answer: infared types like the sun, sun light, heat lamps, and radiators

HOW TO DOWNLOAD BEAMNG DRIVE

Answers

Explanation:

Answer:

Explanation:

on what device

A train protection system automatically applies the brakes of a train if the speed limit for a segment of track is exceeded, or if the train enters a track segment that is currently signaled with a red light (i.e., the segment should not be entered). There are two critical-safety requirements for this train protection system:
The train shall not enter a segment of track that is signaled with a red light.
The train shall not exceed the specified speed limit for a section of track.
Assuming that the signal status and the speed limit for the track segment are transmitted to on-board software on the train before it enters the track segment, propose five possible functional system requirements for the onboard software that may be generated from the system safety requirements.

Answers

Explanation:

Five possible functional system requirements for the onboard software that may be generated from the system safety requirements:

software should enable the brakes to be applied instantly when the red light is signaled.speed of the train should be monitored when it's running on a segment so that it does not exceed the maximum speed limit.important for the system to examine the color displayed before a train enters a segment of the track.constant checking of the speed limit and color of the light so as to determine when the brakes should be applied. when there is a red light the system should notify/prevent the train from entering the segment.

Design a class named Complex for representing complex numbers and the methods add, subtract, multiply, divide, abs for performing complex-number operations, and override toString method for returning a string representation for a complex number. The toString method returns a + bi as a string. If b is 0, it simply returns a.
Provide three constructors Complex(a, b), Complex(a), and
Complex(). Complex() creates a Complex object for number 0 and
Complex(a) creates a Complex object with 0 for b. Also provide
the getRealPart() and getImaginaryPart() methods for returning
the real and imaginary part of the complex number, respectively.
Your Complex class should also implement the Cloneable
interface.
Write a test program that prompts the user to enter two complex numbers and display the result of their addition, subtraction, multiplication, and division.
Here is the main class. It cannot be changed.
import java.util.Scanner;
public class Test {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
System.out.print("Enter the first complex number: ");
double a = input.nextDouble();
double b = input.nextDouble();
Complex c1 = new Complex(a, b);
System.out.print("Enter the second complex number: ");
double c = input.nextDouble();
double d = input.nextDouble();
Complex c2 = new Complex(c, d);
System.out.println("(" + c1 + ")" + " + " + "(" + c2 + ")" + " = " + c1.add(c2));
System.out.println("(" + c1 + ")" + " - " + "(" + c2 + ")" + " = " + c1.subtract(c2));
System.out.println("(" + c1 + ")" + " * " + "(" + c2 + ")" + " = " + c1.multiply(c2));
System.out.println("(" + c1 + ")" + " / " + "(" + c2 + ")" + " = " + c1.divide(c2));
System.out.println("|" + c1 + "| = " + c1.abs());
Complex c3 = (Complex)c1.clone();
System.out.println(c1 == c3);
System.out.println(c3.getRealPart());
System.out.println(c3.getImaginaryPart());
}
}

Answers

Answer:

Explanation:

The following code is written in Java, it creates the entire complex class as requested so that it works with the main method that has been provided in the question without having to change anything in the main method. Proof of output can be seen in the attached picture below

import java.util.Scanner;

class Test implements Cloneable{

   public static void main(String[] args) {

       Scanner input = new Scanner(System.in);

       System.out.print("Enter the first complex number: ");

       double a = input.nextDouble();

       double b = input.nextDouble();

       Complex c1 = new Complex(a, b);

       System.out.print("Enter the second complex number: ");

       double c = input.nextDouble();

       double d = input.nextDouble();

       Complex c2 = new Complex(c, d);

       System.out.println("(" + c1 + ")" + " + " + "(" + c2 + ")" + " = " + c1.add(c2));

       System.out.println("(" + c1 + ")" + " - " + "(" + c2 + ")" + " = " + c1.subtract(c2));

       System.out.println("(" + c1 + ")" + " * " + "(" + c2 + ")" + " = " + c1.multiply(c2));

       System.out.println("(" + c1 + ")" + " / " + "(" + c2 + ")" + " = " + c1.divide(c2));

       System.out.println("|" + c1 + "| = " + c1.abs());

       Complex c3 = c1;

       System.out.println(c1 == c3);

       System.out.println(c3.getRealPart());

       System.out.println(c3.getImaginaryPart());

   }

}

class Complex implements Cloneable {

   public interface Cloneable { }

   private double realPart;

   public double getRealPart() {

       return realPart;

   }

   public void setReal(double real) {

       this.realPart = real;

   }

   private double imaginaryPart;

   public double getImaginaryPart() {

       return imaginaryPart;

   }

   public void setImaginary(double imaginary) {

       this.imaginaryPart = imaginary;

   }

   public Complex(double a, double b) {

       realPart = a;

       imaginaryPart = b;

   }

   public Complex(double a) {

       realPart = a;

       imaginaryPart = 0;

   }

   public Complex() { }

   public Complex add(Complex comp2) {

       double real1 = this.getRealPart();

       double real2 = comp2.getRealPart();

       double imaginary1 = this.getImaginaryPart();

       double imaginary2 = comp2.getImaginaryPart();

       return new Complex(real1 + real2, imaginary1 + imaginary2);

   }

   public Complex abs() {

       double real1 = Math.abs(this.getRealPart());

       double imaginary1 = Math.abs(this.getImaginaryPart());

       return new Complex(real1, imaginary1);

   }

   public Complex subtract(Complex comp2) {

       double real1 = this.getRealPart();

       double real2 = comp2.getRealPart();

       double imaginary1 = this.getRealPart();

       double imaginary2 = comp2.getRealPart();

       return new Complex(real1 - real2, imaginary1 - imaginary2);

   }

   public Complex multiply(Complex comp2) {

       double real1 = this.getRealPart();

       double real2 = comp2.getRealPart();

       double imaginary1 = this.getRealPart();

       double imaginary2 = comp2.getRealPart();

       return new Complex(real1 * real2, imaginary1 * imaginary2);

   }

   public Complex divide(Complex comp2) {

       double real1 = this.getRealPart();

       double real2 = comp2.getRealPart();

       double imaginary1 = this.getRealPart();

       double imaginary2 = comp2.getRealPart();

       return new Complex(real1 / real2, imaginary1 / imaginary2);

   }

   public String toString() {

       String result;

       result = realPart + " + " + imaginaryPart + "i";

       return result;

   }

}

an image can have only one background layer true or false​

Answers

Answer:

True

Explanation:

The background will always just be the background. You cannot blend two images together to make two background because it would be considered one background nonetheless.

Careers emerge solely to make profit for the industry.


False

True

Answers

Explanation:

Careers emerge solely to make profit for the industry: False

Brainliest and follow and thanks

morning dude

def shared_motif(dna_list):
This function takes in a list of DNA strings and returns the longest common substring. A substring is a contiguous sequence of characters within a string. A common substring is a substring of every element in the given list of DNA strings. Note that the number of DNA strings in the input list is not always the same! There may be multiple solutions, but you only need to return the first one.
Example:
Sample input DNA list:
("GATTACA", "TAGACCA", "ATACA"]
The returned longest common substring:
"TA"

Answers

Answer:

Explanation:

The following code is written in Python, the function creates various nested loops to loop through each individual string comparing letter by letter in order to find the longest common substring. Finally, returning the substring itself.

def shared_motif(dna_list):

   substr = ''

   if len(dna_list) > 1 and len(dna_list[0]) > 0:

       for x in range(len(dna_list[0])):

           for i in range(len(dna_list[0]) - x + 1):

               if i > len(substr) and all(dna_list[0][x:x + i] in y for y in dna_list):

                   substr = dna_list[0][x:x + i]

   return substr

arr = ["GATTACA", "TAGACCA", "ATACA"]

stems = shared_motif(arr)

print(stems)

what are the difference between bit address 7ch and byte address 7ch

Answers

so a byte address can only send  a get bytes (8 bits)

when a bit address can be more detailed as it can send a get not only bytes but bits also

-scav

is the minimum level of security mechanism in a
system.
Select one:
O Baseline
O Security model
O Security policy
O Reconnaissance​

Answers

Answer:

Security policy is the minimum

Explanation:

Which line of code will use the overloaded multiplication operation?

class num:
def __init__(self,a):
self.number = a

def __add__(self,b):
return self.number + 2 * b.number

def __mul__(self, b):
return self.number + b.number

def __pow__(self, b):
return self.number + b.number

# main program
numA = num(5)
numB = num(10)

Which line of code will use the overloaded multiplication operation?

class num:
def __init__(self,a):
self.number = a

def __add__(self,b):
return self.number + 2 * b.number

def __mul__(self, b):
return self.number + b.number

def __pow__(self, b):
return self.number + b.number

# main program
numA = num(5)
numB = num(10)

a) product = numA * numB
b) product = numA.multiply(numB)
c) product = numA.mul(numB

Answers

For multiplication one: product = numA * numB

For the addition: result = numA + numB

got 100 on this ez

(searched all over internet and no one had the answer lul hope this helps!)

Answer: First option: product = numA * numB

second option-numA + numB

Explanation:

Other Questions
The rate for the decomposition of HI is given. What happens to the rate when the concentration of HI is tripled?R = k[HI]2The rate does not change.The rate triples.The rate increases by a factor of 6.The rate increases by a factor of 9. Find the lateral surface area of the cylinder. Round your answer to the nearest tenth.Im not too sure how to do lateral surface area PLEASEEE help me!!! No links though!!!! Which of the following is not a factor that affects the rate at which a rock weathers? a. Rock colorb. TimeC. Surface aread. Chemical composition define one ampere current electricity -7 2/3 + (-5 1/2) + 8 3/4 = ?? what are the lengths of sides a and b? What is the acceleration of a 250 kg object pushed with a force of 7500 newtons? Megan has $45.12 in her purse. She spends $7.89 for lunch and $21.25 for a pair of sunglasses.Which is the best estimate for the amount of money Megan has left? Order these sounds from loudest (1) to softest (4). airplane: whisper: crowd at sporting event: rainfall: Thermohaline circulation A class has five students. What is the probability that exactly two of the students were born on a weekend? Simplify (3x^4 - 4 - 5x^2) - (1 - x^2 + 2x^3) Surrealist attack the emphasis placed on Amelia went shopping for a new camera because of a sale. The store was offering a 30% discount. What number should she multiply the prices on the tags by to find the price she would have to pay, before tax, in one step? Someone help plz make sure its right? Who led the communist party of China and where was its base of power? 201713 Two identical number cubes are shown in the picture. The edge length of these number cubesis 3 centimeters.What is the combined volume of the two number cubes in cubic centimeters?A 54 cmB 18 cmC9 cmD 27 cm Write the algebraic expression that matches each graph ...y = ___ quadratic equations of the form _____ can be solved using square roots What are the zeros of f(x) = x^2 - x-20?A. x=-10 and x = 2B. x= -5 and x = 4C. x=-4 and x = 5D. X=-2 and x = 10