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)
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)
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)
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)
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)
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)
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)
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])
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])
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)