def main(): ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995) python = ProgrammingLanguage("Python", "Dynamic", True, 1991) vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991) languages = [ruby, python, vb] print("The dynamically typed languages are:") for language in languages: if language.is_dynamic(): print(language)
def main(): ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995) python = ProgrammingLanguage("Python", "Dynamic", True, 1991) vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991) print(ruby) print(python) print(vb) list = [ruby, python, vb]
def main(): ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995) python = ProgrammingLanguage("Python", "Dynamic", True, 1991) vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991) print(ruby) print(python) print(vb) for lang in ruby, python, vb: if lang.is_dynamic(): print("The dynamically typed languages are:", lang.name)
def main(): ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995) python = ProgrammingLanguage("Python", "Dynamic", True, 1991) vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991) print(ruby) print(python) print(vb) print("The dynamically typed languages are:") list = [python, vb, ruby] for each in list: if each.is_dynamic(): print(each.name)
def update(id): jsonInput = json.loads(json.dumps(request.get_json(silent=True))) if not id or not jsonInput: abort(400) name = str(jsonInput['name']) year = str(jsonInput['year']) designer = str(jsonInput['designer']) program = ProgrammingLanguage(id, name, year, designer) database.update(program) return "success"
def insert(): jsonInput = json.loads(json.dumps(request.get_json(silent=True))) if not jsonInput: abort(400) name = str(jsonInput['name_new']) year = str(jsonInput['year_new']) designer = str(jsonInput['designer_new']) error = ProgrammingLanguageExceptions.checkAllMandatory( name, designer, year) if error: return json.dumps({'message': error}), 400 program = ProgrammingLanguage(id, name, year, designer) database.insert(program) sendToQue.sendErrorToQue('success') return "success"
from programminglanguage import ProgrammingLanguage ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995) python = ProgrammingLanguage("Python", "Dynamic", True, 1991) vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991) languages = [ruby, python, vb] print("The dynamically typed languages are:") for language in languages: if language.is_dynamic(): print(language.name)
from programminglanguage import ProgrammingLanguage ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995) python = ProgrammingLanguage("Python", "Dynamic", True, 1991) vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991) output="The dynamically typed languages are:\n" language_list=[ruby,python,vb] for element in language_list: if ProgrammingLanguage.is_dynamic(element.typing): output+=element.name+"\n" print(output)