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
Nadusha1986 [10]
3 years ago
15

Write a program that prompts the user to enter two positive integers a and b with a < b and then prints the list of all the p

erfect squares that are between a and b, inclusive
Computers and Technology
1 answer:
Debora [2.8K]3 years ago
5 0

Answer:

Written in Python

import math

a = int(input("a: "))

b = int(input("b: "))

for i in range(a,b+1):

    sqqrt = math.sqrt(i)

         if int(sqqrt + 0.5) ** 2 == i:

              print(i,end=' ')

Explanation:

This line import math library

import math

This line prompts user for user input (a)

a = int(input("a: "))

This line prompts user for user input (b)

b = int(input("b: "))

This iterates from a to b (inclusive)

for i in range(a,b+1):

This checks for perfect square

<em>     sqqrt = math.sqrt(i)</em>

<em>          if int(sqqrt + 0.5) ** 2 == i:</em>

This prints the number if it is a perfect square

              print(i,end=' ')

You might be interested in
You find a list of numbers on the kitchen counter, but you aren’t sure what the numbers represent. This is an example of:
Pie

Answer:

I say that this would be data. It is the one that makes the most sense, because in math, that would be the data that you may not know what to do with....YET!! Hope this was helpful!

8 0
3 years ago
Read 2 more answers
What is the working principle of computer?
ankoles [38]
The CPU is the working principle
8 0
4 years ago
When opening a file in Windows, the creation of ____ helps bridge the gap between the characteristics of physical devices and di
ololo11 [35]

Answer:

an electronic computer folder

4 0
4 years ago
Which of the following words is an anatomy for cautious
liraira [26]
Uh, I think you mean antonym.

Anyways, here are some antonyms.

Careless, Certain, Foolish, Inattentive, Incautious
8 0
4 years ago
Another pitfall cited in Section 1.10 is expecting to improve the overall performance of a computer by improving only one aspect
Alexandra [31]

Answer:

<u>note:</u>

<em><u>solution is attached in word form due to error in mathematical equation. furthermore i also attach Screenshot of solution in word due to different version of MS Office please find the attachment</u></em>

Download docx
8 0
4 years ago
Other questions:
  • Which of the following BEST represents the relationship between physical fitness and exercise?
    6·1 answer
  • If the processor has 32 address lines in its address bus; i.e. 32-bit address range, what is its address space or range; i.e. wh
    10·1 answer
  • 8. How can you prevent your VMs receiving DHCP server messages from unauthorized virtual machine pretending to be DHCP servers?
    6·1 answer
  • 1.Input device which transfers information and images from physical documents to computer files.
    14·1 answer
  • How should the teachers respond to the parental complaints of student C? If they fail the student, the student will likely be re
    11·1 answer
  • python Create a new qualitative variable, called Elite, by binning the Top10perc variable. We are going to divide universities i
    6·1 answer
  • What would be the best thing you could do to prepare yourself to work for a company that has embraced globalization. A) learn ho
    12·2 answers
  • What are some disadvantages of using a word processor over a type writer?​
    7·1 answer
  • Buddys machine shop has a kiosk computer located in the lobby for customers to use. The kiosk computer has recently been updated
    13·1 answer
  • TensorFlow and Pytorch are examples of which type of machine learning platform?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!