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
As the European powers grew more industrialized, their colonies became very important as sources of A)slave labor. B)raw materia
nadezda [96]
B) Raw materials; As stated, European powers did indeed grow more industrialized, therefore they needed more raw materials. The North provided lumber, spent time whaling, etc.. The South spent time growing cash crops such as rice, cotton, and indigo. 
8 0
3 years ago
Read 2 more answers
Key Categories: more libraries and thousands of functions
stich3 [128]





b. power
YOUR WELXOME



4 0
3 years ago
What is the informal language that programmers use to create models of programs that have no syntax rules and are not meant to b
Yuri [45]
Pcode (Pseudo-code).

-----------------------------
5 0
3 years ago
Why is Data-Driven Analytics of interest to companies?
vivado [14]

Answer:

It allows companies to make definitive predictions about the future. It gives companies the ability to make informed decisions.

It helps Data Analysts shape an analytics problem from a business problem.

Explanation:

4 0
2 years ago
A(n) __________is an output device that enable a machine operator to view the acc or pre vlaue of an insstruction without the us
antoniya [11.8K]

A <u>LED display</u> is an output device that enable a machine operator to view the acc or pre vlaue of an insstruction without the use of a programming terminal

<h3>What is LED display device?</h3>

LED Display (light-emitting diode display) is a screen display technology that uses a panel of LEDs as the light source. Currently, a large number of electronic devices, both small and large, use LED display as a screen and as an interaction medium between the user and the system.

<h3>Where is LED display used?</h3>

An LED (Light-Emitting Diode) is a small cell or conductor that glows and becomes illuminated when a voltage is applied to it. The phrase 'LED display' is often used broadly to describe screens on a wide range of devices. This includes commercial and consumer technology such as TVs, mobile phones, and PC monitors.

To learn more about LED Display , refer

brainly.com/question/17019750

#SPJ4

8 0
1 year ago
Other questions:
  • What should you do if your computer keeps shutting down while working?
    9·2 answers
  • A technician replaces a defective 250GB hard drive in a desktop with a 2TB hard drive. After installation, the computer detects
    5·1 answer
  • A beginning driver may tend to oversteer. This means the driver what? Btw Cars are technology so that is why it is under Compute
    11·1 answer
  • Which option nukes your systemâall apps, programs, user files, user settingsâand presents a fresh installation of Windows?
    13·1 answer
  • You work for a company that does network cable installations. Your company has been contracted to pull out the existing CAT 3 wi
    11·1 answer
  • Pls help I will give points
    7·1 answer
  • Define the terms data and information ??​
    8·2 answers
  • What was software for modems that connected through phone lines called?
    6·1 answer
  • What is the primary difference among a domain model, an analysis model, and a design model for the same project?
    15·1 answer
  • I need help with humans need not apply for codeing
    15·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!