def ex2runs(path): """Test w2 ex2 to check it works.""" try: import exercise2 return exercise2.week2exersise2() == "MC Hammer" except Exception as e: print("\nThere is a syntax error", str(e)) return False
def ex2runs(path): """Test w2 ex2 to check it works.""" try: if path: imp.load_source("exercise2", os.path.join(path, "week" + str(WEEK_NUMBER))) return True else: import exercise2 return True return exercise2.week2exersise2() == "MC Hammer" except Exception as e: print("\nThere is a syntax error", str(e)) return False