Skip to content

Instantly share code, notes, and snippets.

@elyosemite
Created August 31, 2019 18:36
Show Gist options
  • Select an option

  • Save elyosemite/23d1d04153570a013aa5ec1c92c92f2e to your computer and use it in GitHub Desktop.

Select an option

Save elyosemite/23d1d04153570a013aa5ec1c92c92f2e to your computer and use it in GitHub Desktop.
# Square Root
num = int(input("Your number: "))
imp = []
preResult = num
# Getting the odd numbers
for i in range(1, num, 2):
imp.append(i)
# Executing
for i in range(len(imp)):
preResult = preResult - imp[i]
if preResult <= 0:
print 'Square Root: ', i+1
break
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment