79364774

Date: 2025-01-17 12:40:06
Score: 2.5
Natty:
Report link

What about checking the type of input inside the function and adapt it ?

def f(x):    # for float or np.array
    if type(x) is float:
        x = x * np.ones(1)
    while np.max(x)>1e-5:
       x = x/2
    return x
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Ends in question mark (2):
  • Starts with a question (0.5): What
Posted by: rehaqds