Ejemplo n.º 1
0
def main():
    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)

    print(python)
    languages = [ruby, python, visual_basic]
    print("The dynamically typed languages are:")
    for language in languages:
        if language.is_dynamic():
            print(language.name)
Ejemplo n.º 2
0
def language_test():
    java = ProgrammingLanguage("Java", "Static", True, 1995)
    cplusplus = ProgrammingLanguage("C++", "Static", True, 1983)
    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)
    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    languages = [java, cplusplus, python, visual_basic, ruby]
    print(python)
    print("The dynamically typed languages are:")
    for language in languages:
        if language.is_dynamic():
            print(language.name)
Ejemplo n.º 3
0
def main():
    ruby = ProgrammingLanguage("Ruby", "Dynamic", "Yes", 1995)
    python = ProgrammingLanguage("Python", "Dynamic", "Yes", 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", "No", 1991)

    print(ruby)
    print(python)
    print(visual_basic)

    programming_languages = [ruby, python, visual_basic]

    print("The dynamically typed languages are: ")
    for programming_language in programming_languages:
        if programming_language.typing == "Dynamic":
            print(programming_language.name)
Ejemplo n.º 4
0
def main():
    language_list = []
    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)
    language_list.append(ruby)
    language_list.append(python)
    language_list.append(visual_basic)
    print(ruby)
    print(python)
    print(visual_basic)
    print("The dynamically typed languages are:")
    for language in language_list:
        if language.typing == "Dynamic":
            print(language.name)
Ejemplo n.º 5
0
def main():
    """Main."""
    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)

    print(ruby)
    print(python)
    print(visual_basic)

    languages = [ruby, python, visual_basic]
    print("The Dynamic typed languages are:")
    # print([language.name for language in languages if language.is_dynamic()])
    for language in languages:
        if language.is_dynamic():
            print(language.name)
Ejemplo n.º 6
0
def main():
    """Simple programme to test programming language code."""
    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)

    print(ruby)
    print(python)
    print(visual_basic)
    languages = [ruby, python, visual_basic]
    # language_display = [language for language in languages if language.is_dynamic()]
    # print(language_display)
    # print("The dynamic languages are:\n:{}\n".format(language_display))

    print("The dynamically typed languages are:")
    for language in languages:
        if language.is_dynamic():
            print(language.name)
Ejemplo n.º 7
0
def main():

    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    print(ruby)


    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    print(python)


    vb = ProgrammingLanguage("Visual Basic", "Static", False, 1991)
    print(vb)

    language_list = [ruby, python, vb]

    print("\nThe dynamically typed languages are:")
    for lang in language_list:
        if lang.typing == "Dynamic":
            print(lang.name)
Ejemplo n.º 8
0
from prac_07.programming_language import ProgrammingLanguage

ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)

languages = []
languages.append(ruby)
languages.append(python)
languages.append(visual_basic)

print("The dynamically typed languages are:")
for language in languages:
    if language.typing == "Dynamic":
        print(language.name)

# dynamic_languages = [language.name for language in languages if language.typing == "Dynamic"]
# for i in range(len(dynamic_languages)):
#     print(dynamic_languages[i])
Ejemplo n.º 9
0
def main():
    ruby = ProgrammingLanguage("Ruby", "Dynamic", True, 1995)
    python = ProgrammingLanguage("Python", "Dynamic", True, 1991)
    visual_basic = ProgrammingLanguage("Visual Basic", "Static", False, 1991)
    print(python)
    display_dynamic_languages([ruby, python, visual_basic])
Ejemplo n.º 10
0
from prac_07.programming_language import ProgrammingLanguage

languages = [
    ProgrammingLanguage("Ruby", "Dynamic", True, 1995),
    ProgrammingLanguage("Python", "Dynamic", True, 1991),
    ProgrammingLanguage("Visual Basic", "Static", False, 1991)
]

for language in languages:
    print(language)

print("The dynamically typed languages are:")
for language in languages:
    if language.is_dynamic():
        print(language.name)