Skip to content

Instantly share code, notes, and snippets.

@and-semakin
Last active May 17, 2020 17:42
Show Gist options
  • Save and-semakin/6080c25e106dedcecb0326aa4514b738 to your computer and use it in GitHub Desktop.
Save and-semakin/6080c25e106dedcecb0326aa4514b738 to your computer and use it in GitHub Desktop.
from math import *
import itertools
def CalculateSquareRoot (Number ):
return sqrt(Number )
def append_item(item, l=[]):
l.append(item)
return l
while True:
try:
your_number=float(input('Enter your number: '))
print("Square root is:", CalculateSquareRoot(your_number))
break
except:
pass
from math import sqrt
def calculate_square_root(number):
return sqrt(number)
def append_item(item, l=None): # noqa: E741
if l is None:
l = [] # noqa
l.append(item)
return l
while True:
try:
your_number = float(input('Enter your number: '))
print("Square root is:", calculate_square_root(your_number))
break
except Exception:
pass
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment