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]
3 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]3 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 Include the data on usage you gather from your interactions with friends or by listening to people on the radio or on T
borishaifa [10]

Answer:

This has happened many times. I am quite close to my friends. I once asked for making a wood baked Pizza at one of my friends’ houses. Unfortunately. He didn’t have the setup. I was feeling bad as well. However, to add to my relief, he didn’t say he will not make. He also didn’t say he didn’t have the oven. And those double negatives made me happy as I didn’t wanted my friend to take this pain as he had to give an exam after 2 days. However, he even didn’t said he will not order for it. And that double negative confirmed for us a pack of two wood baked pizzas with fountain Pepsi, an hour later. And I was very happy as my friend was able to fulfill the promise.

On TV as well, I have heard a lot of double negatives during NBA matches, and especially on the radio. However, I must say double negatives sometimes happen as certain people are very sensitive, they do not ever want to say no.

Explanation:

Please check the answer.

7 0
3 years ago
What types of activities are ideal for a robot to perform?
LUCKY_DIMON [66]

The type of activities that are ideal for a robot to perform are; Repetitive tasks

Robots are machines that are programmable by a computer which have the capacity of automatically carrying out a complex series of actions.

Now, robots are used in a wide array of industries which include manufacturing, assembly and packaging, transport, earth and space exploration, e.t.c.

The most common use are found primarily in the automobile industry where they are used to carry out repetitive tasks and those that are difficult or hazardous for humans.

Read more about robots at; brainly.com/question/9145476

3 0
3 years ago
Free brainliest!?! <3​
Sholpan [36]

Meee plzzzzz First!............

4 0
3 years ago
Read 2 more answers
How many accelerometers are there in an IRS system?
slega [8]

The number of accelerometers that are in an IRS system are three (3).

<h3>What is an IRS system?</h3>

IRS system is an abbreviation for inertial reference system (IRS) and it can be defined as a navigation system that is designed and developed to provide inertial navigation data to various user systems, especially by using a ring-laser gyro.

In the Aviation and Engineering filed, he number of accelerometers that are in an inertial reference system (IRS) system are three (3).

Read more on navigation system here: brainly.com/question/26052911

#SPJ12

5 0
2 years ago
Match the careers with the education required for each job
Gekata [30.6K]
Statistician for the last one network administaror for the next one then animator then broadcast tech
6 0
3 years ago
Other questions:
  • Airbags only absorb the _____ impact in a crash. initial final mid-stage smallest
    13·1 answer
  • What are the 7 basic components found in a computer tower
    5·2 answers
  • There are several methods of updating information and data on a webserver. We must consider who performs those updates upfront w
    9·2 answers
  • CODE EXAMPLE 3-1 SELECT vendorName, invoiceNumber, invoiceDate, invoiceTotal FROM vendors INNER JOIN invoices ON vendors .vendor
    13·1 answer
  • What is the local portion of the e-mail address below? <a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="
    15·1 answer
  • Ethical design refers to...
    13·1 answer
  • Send me the answers<br>​
    15·1 answer
  • The Table Design and Layout tabs are available under the
    13·2 answers
  • Your program will be used by many departments at the university. Your comments will be important to their IT people. What would
    15·1 answer
  • What is smarta Art ? ​
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!