216k views
4 votes
How would you print out the square roots of integers 1-100?

1 Answer

5 votes

Final answer:

To print out the square roots of integers 1-100 in Python, use a loop and the math module's sqrt() function.

Step-by-step explanation:

To print out the square roots of integers 1-100, you can use a loop to iterate from 1 to 100 and calculate the square root of each number. In Python, you can use the math module's sqrt() function to calculate the square root. Here's an example:

import math

for i in range(1, 101):
print(f'The square root of {i} is {math.sqrt(i)}')

User Lou Morda
by
8.0k points