Generation

generate functionTue, 13 Dec 2022

Make a function that returns the value multiplied by 50 and increased by 6. If the value entered is a string it should return "Error".

def math(a): if type(a) == str: return "Error" elif type(a) == int: return (a * 50) + 6 print(math(1)) print(math("Hello")) print(math(2))

Questions about programming?Chat with your personal AI assistant