Exemple #1
0
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]
Exemple #3
0
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)
Exemple #4
0
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)
Exemple #5
0
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"
Exemple #6
0
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"
Exemple #7
0
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)
Exemple #8
0
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)