2
It is for python 3:
What I’m looking to do is show the rest of a square-root account that only accepts as many integers as possible as an answer. For example:
import math
x=math.sqrt(87)
print(x)
This code returns 9.327379053088816, I want my code to return only 9 and show me the rest that in this case would 6(The numbers in bold are the ones I want appearing) since 9²=81 and 87-81=6...would be +- what the function % + the function// do in the division. Only now on square root.
I think I explained what I want the best I could, someone can help me in this crazy request XD?
would be something like:
radicando = 87
x = math.sqrt(radicando)
z = radicando - (2*math.int(x))
print(z)
?– Armando Marques Sobrinho
in case I was wrong here, changes the variable z to
z = math.int(x) * math.int(x)
in order to take the square from the root, it was bad.– Armando Marques Sobrinho
Sorry, Armando your code didn’t work, the code I wanted was what Anderson suggested down there, thanks anyway.
– Mateus
Wow, @Matheus, so I really wanted to help.
– Armando Marques Sobrinho