Python root | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
0

Python root

How to calculate the root of a number through a python?

18th Mar 2022, 2:14 AM
Nexus
Nexus - avatar
2 Antworten
18th Mar 2022, 2:51 AM
Gordon
Gordon - avatar
+ 1
Calculate integer square root: def intsqrt(n): x = 2 for i in range(50): x += n//x x >>= 1 return x
20th Mar 2022, 12:43 AM
Brian
Brian - avatar