1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
Oliga [24]
2 years ago
13

Assume there are two variables, k and m, each already associated with a positive integer value and further assume that k's value

is smaller than m's. Write the code necessary to compute the number of perfect squares between k and m. (A perfect square is an integer like 9, 16, 25, 36 that is equal to the square of another integer (in this case 3*3, 4*4, 5*5, 6*6 respectively).) Associate the number you compute with the variable q. For example, if k and m had the values 10 and 40 respectively, you would assign 3 to q because between 10 and 40 there are these perfect squares: 16, 25, and 36,.
PYTHON CODING
Computers and Technology
1 answer:
ehidna [41]2 years ago
8 0

Answer:

import math  

def isPerfectSquare(n):

 s = int(math.sqrt(n))

 return n == s*s

def countPerfectSquares(k,m):

 q = 0

 for i in range(k,m):

   if isPerfectSquare(i):

     q=q+1

 return q

print(countPerfectSquares(10,40))

Explanation:

Note that this is including the k, but excluding m. If you want to include m, write m+1 in the range expression.

You might be interested in
What are some facts about webmasters?
FromTheMoon [43]
Webmasters monitor  the server to be sure  it is  running,Some webmasters decide what kind of  computer will hold a websites information ,Some webmasters abuse other sites by exploiting their comment fields.
4 0
3 years ago
A user reports network resources can no longer be accessed. The PC reports a link but will only accept static IP addresses. The
Aloiza [94]

Answer: is this a real question but I think it would be Ip address hope this helps :)))

Explanation:

3 0
2 years ago
Percentage-wise, which renewable energy source is used most?
Natasha2012 [34]
C)Hydroelectric I believe.
5 0
3 years ago
I need help with this!!! Are headphones, radios, dishwashers, and remote controls considered Computers? Do any of them store dat
Bogdan [553]

Answer:

Yes, these things can be considered a computer. And they can also store and process data.

Explanation:

Headphones, radios, dishwashers, and remote controls are all computers because they all have some sort of logic board inside the device to control what it does. Example, a dishwasher has internal components that it uses to keep track of how long the wash/rinse cycle have lasted and how long they are supposed to last.

I hope that helps!

7 0
2 years ago
In which area is composing for games different from composing for movies?
kondaur [170]

Answer: royalties earned

Explanation:

In areas such as the looping scores, temp tracks and adaptive scores, there are similarities when composing for games and when composing for movies.

The area where there is difference when composing for games and composing for movies is the royalties earned. The interest that is earned on royalties for both cases are different.

8 0
3 years ago
Other questions:
  • The specifications for ____ are developed by the world wide web consortium (w3c) and are continually evolving.
    13·1 answer
  • Amazon Web Services (AWS): Group of answer choices a) forms a majority percentage of Amazon's overall revenue. b) was introduced
    15·1 answer
  • ________ are websites that provide collections of content from all over the world wide web a. aggregators b. social networks c.
    6·1 answer
  • Which of the following code segments could be used to skip the first two characters of an input line (they may or may not be whi
    13·1 answer
  • On the Attendance worksheet, in cell L5, enter an IF function to determine if the percentage in cell K5 is greater than or equal
    9·1 answer
  • A newly opened law firm in Kirkland decides to create a small website that provides a brief introduction of the firm, its missio
    8·1 answer
  • Ciscon Telecom is a mobile operator in the European Union. The company provides personalized services to its customers, and its
    8·2 answers
  • Stacy plans to print her contacts and would like to choose an option that will print select information for each contact in a bu
    11·1 answer
  • Need answer ASAP!!!!
    14·1 answer
  • What will help the programmer understand what’s going on in the program?
    12·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!