Generation

generate functionWed, 22 Feb 2023

Write a function that gives True (except for 777) if the number ends with 77, and False in other cases

def is77(x): str_x = str(x) if str_x[-2:] == '77' and str_x != '777': return True else: return False is77(77)

Questions about programming?Chat with your personal AI assistant