11 Sep
2023
11 Sep
'23
9:27 p.m.
I slightly raised the model quality and got this :)
Write code that evaluates the probability of whether or not random strings have square roots. Do not comment on the code. def has_square_root(s): try: int(s) ** 0.5 return True except ValueError: return False
print(has_square_root("16")) # True print(has_square_root("17")) # False print(has_square_root("abc")) # False