In this code there are two errors. The first refers to the function print in the code line of input() - you must remove it. And the second mistake was that you called the library Math without importing it previously - in this case, you need to import the library Math.
Something else, if you’re using python 3.8 or higher you can make the code more concise using the concepts of Assignment Expressions.
Well, that way we can implement the following code:
from math import sqrt
while (n := int(input('Digite um número inteiro: '))) < 0:
print('Valor INVÁLIDO!')
print(f'A raiz quadrada de {n} é: {sqrt(n):.2f}')
Note that when we execute this code we receive the following message: Digite um número inteiro:
. Right now we must enter an integer number and press Enter.
From this moment the block while verify whether the value assigned to the variable n is less than 0. Positive case - the value being in fact a negative number - the message will be displayed INVALID VALUE! and otherwise the square root of n will be calculated, then the value of n will be displayed, as well as the value of its root.
Note that we can also resolve this issue without having to import the Math library. To do this just write the square root operation in the code.
OBSERVING:
The square root of x is: x ** (1/2).
This way the code will stay:
while (n := int(input('Digite um número inteiro: '))) < 0:
print('Valor INVÁLIDO!')
print(f'A raiz quadrada de {n} é: {n ** (1 / 2):.2f}')
Also note that not all squared is a perfect square. Therefore, not every square root will be integer. Therefore, I have implemented in both codes the rounding of the square root value to two decimal places.