예제 #1
0
def run_simple_decision():
    while (True):
        print("[a] comparison operator program")
        print("[b] counter program")
        print("[c] Use of if statement  program")
        print("[d] Use of if elif else program")
        print("[e] Use of if else program")
        print("[f] modular operator program")
        print("[q] to quit")
        print(" please Enter which program you want to Execute")
        print(" press a/b/c/d/e/f/q")
        choice = input().lower().strip()
        if choice == "a":
            comparison_operators.run()
        elif choice == "b":
            counter.run()
        elif choice == "c":
            if1.run()
        elif choice == "d":
            if_elif_else.run()
        elif choice == "e":
            if_else.run()
        elif choice == "f":
            modulo_operator.run()
        elif choice == "q":
            break
        else:
            print("Invalid option! Please try again.")
예제 #2
0
파일: main.py 프로젝트: danbird2021/com728
def run_simple_decisions():
    while (True):
        print("""Run any of the following from Block A: Simple Decisions:
                 [a] : comparison_operators.py
                 [b] : counter.py
                 [c] : if.py
                 [d] : if_elif_else.py
                 [e] : if_else.py
                 [f] : modulo_operator.py
                 [g] : and_operator.py
                 [h] : or_operator.py
                 [i] : review.py
                 [m] : Block A Menu """)
        response = input()

        if response == "a":
            comparison_operators.run()
        elif response == "b":
            counter.run()
        elif response == "c":
            decision_if.run()
        elif response == "d":
            if_elif_else.run()
        elif response == "e":
            if_else.run()
        elif response == "f":
            modulo_operator.run()
        elif response == "g":
            and_operator.run()
        elif response == "h":
            or_operator.run()
        elif response == "i":
            decision_review.run()
        elif response == "m":
            break
        else:
            print("Invalid option! Please try again.")
예제 #3
0
def run_block_a():
    print("Which program in 'Block A: Basics' do you wish to run?")
    response = input()

    # function calls for basics --> output
    if response == "simple_message":
        simple_message.run()
    elif response == "multiline_message":
        multiline_message.run()
    elif response == "ascii_art":
        ascii_art.run()
    elif response == "escape_characters":
        escape_characters.run()

    # function calls for basics --> repetitions --> while loops
    elif response == "sum_user_numbers":
        sum_user_numbers.run()
    elif response == "sum_100":
        sum_100.run()
    elif response == "while_simple":
        while_simple.run()
    elif response == "len":
        len.run()
    elif response == "factorial":
        factorial.run()
    elif response == "count":
        count.run()
    elif response == "ascii":
        ascii.run()

    # function calls for basics --> repetitions --> nested loops
    elif response == "nested":
        nested.run()
    elif response == "nesting":
        nesting.run()

    # function calls for basics --> repetitions --> for loops
    elif response == "characters":
        characters.run()
    elif response == "count_down":
        count_down.run()
    elif response == "membership_operators":
        membership_operators.run()
    elif response == "range":
        range.run()
    elif response == "reverse":
        reverse.run()
    elif response == "simple":
        simple.run()

    # function calls for basics --> modules
    elif response == "guess_the_number":
        guess_the_number.run()

    # function calls for basics --> input
    elif response == "ascii_robot":
        ascii_robot.run()
    elif response == "data_types":
        data_types.run()
    elif response == "review_beeps_garden":
        review_beeps_garden.run()
    elif response == "string_operators":
        string_operators.run()
    elif response == "user_input":
        user_input.run()

    # function calls for basics --> functions
    elif response == "ascii_character":
        ascii_character.run()
    elif response == "ascii_code":
        ascii_code.run()
    elif response == "function_calls":
        function_calls.run()
    elif response == "function_with_loop":
        function_with_loop.run()
    elif response == "function_with_nesting":
        function_with_nesting.run()
    elif response == "function_with_parameter":
        function_with_parameter.run()
    elif response == "function_with_parameters":
        function_with_parameters.run()
    elif response == "multiple_functions":
        multiple_functions.run()
    elif response == "return_values":
        return_values.run()
    elif response == "simple_function":
        simple_function.run()

    # function calls for basics --> decisions
    elif response == "and_operator":
        and_operator.run()
    elif response == "or_operator":
        or_operator.run()
    elif response == "decision_review":
        decision_review.run()

    # function calls for basics --> decisions --> simple decision
    elif response == "comparison_operators":
        comparison_operators.run()
    elif response == "counter":
        counter.run()
    elif response == "decision_if":
        decision_if.run()
    elif response == "if_elif_else":
        if_elif_else.run()
    elif response == "if_else":
        if_else.run()
    elif response == "modulo_operator":
        modulo_operator.run()

    # function calls for basics --> decisions --> nested decision
    elif response == "nestception":
        nestception.run()
    elif response == "nested_decision":
        nested_decision.run()

    else:
        print("please enter a valid response")
예제 #4
0
def run_block_a():
    print("Which program in 'Block A: Basics' do you wish to run?")
    response = input()

    #Output
    if (response == "simple_message"):
        simple_message.run()
    elif (response == "multiline_message"):
        multiline_message.run()
    elif (response == "escape_characters"):
        escape_characters.run()
    elif (response == "ascii_art"):
        ascii_art.run()

    #Input
    elif (response == "user_input"):
        user_input.run()
    elif (response == "ascii_robot"):
        ascii_robot.run()
    elif (response == "data_types"):
        data_types.run()
    elif (response == "string_operators"):
        string_operators.run()

    #Decisions> Simple Decisions
    elif (response == "if_"):
        if_.run()
    elif (response == "if_else"):
        if_else.run()
    elif (response == "if_elif_else"):
        if_elif_else.run()
    elif (response == "modulo_operator"):
        modulo_operator.run()
    elif (response == "comparison_operators"):
        comparison_operators.run()
    elif (response == "counter"):
        counter.run()
    elif (response == "nested"):
        nested.run()
    elif (response == "nestception"):
        nestception.run()
    elif (response == "or_operator"):
        or_operator.run()
    elif (response == "and_operator"):
        and_operator.run()

    #Repetitions
    #Repetitions> while_loop
    elif (response == "simple_while_loop"):
        simple_while_loop.run()
    elif (response == "count"):
        count.run()
    elif (response == "ascii_"):
        ascii_.run()
    elif (response == "sum_100"):
        sum_100.run()
    elif (response == "sum_user_numbers"):
        sum_user_numbers.run()
    elif (response == "factorial"):
        factorial.run()
    elif (response == "len_"):
        len_.run()

    #Repetitions> for_loop
    elif (response == "simple_for_loop"):
        simple_for_loop.run()
    elif (response == "count_down"):
        count_down.run()
    elif (response == "range_"):
        range_.run()
    elif (response == "characters"):
        characters.run()
    elif (response == "reverse"):
        reverse.run()
    elif (response == "membership_operators"):
        membership_operators.run()

    #Repetitions> nested_loop
    elif (response == "nested_"):
        nested_.run()
    elif (response == "nesting"):
        nesting.run()

    #Functions
    elif (response == "ascii_code"):
        ascii_code.run()
    elif (response == "ascii_character"):
        ascii_character.run()
    elif (response == "simple_function"):
        simple_function.run()
    elif (response == "function_with_nesting"):
        function_with_nesting.run()
    elif (response == "function_with_parameter"):
        function_with_parameter.run()
    elif (response == "function_with_loop"):
        function_with_loop.run()
    elif (response == "function_with_parameters"):
        function_with_parameters.run()
    elif (response == "multiple_functions"):
        multiple_functions.run()
    elif (response == "return_values"):
        return_values.run()
    elif (response == "function_calls"):
        function_calls.run()

    #Modules
    elif (response == "guess_the_number"):
        guess_the_number.run()
예제 #5
0
def run_block_a():
    print("Which program in 'Block A: Basics' do you wish to run?")
    response = input()
    if response == "simple_message":
        simple_message.run()
    elif response == "multiline_message":
        multiline_message.run()
    elif response == "escape_characters":
        escape_characters.run()
    elif response == "ascii_art":
        ascii_art.run()
    elif response == "ascii_robot":
        ascii_robot.run()
    elif response == "data_types":
        data_types.run()
    elif response == "review_input":
        review_input.run()
    elif response == "string_operators":
        string_operators.run()
    elif response == "user_input":
        user_input.run()
    elif response == "review_decisions":
        review_decisions.run()
    elif response == "or_operator":
        or_operator.run()
    elif response == "and_operator":
        and_operator.run()
    elif response == "comparison_operators":
        comparison_operators.run()
    elif response == "counter":
        counter.run()
    elif response == "if_elif":
        if_elif.run()
    elif response == "if_else":
        if_else.run()
    elif response == "modulo_operator":
        modulo_operator.run()
    elif response == "nestception":
        nestception.run()
    elif response == "nested":
        nested.run()
    elif response == "count_down":
        count_down.run()
    elif response == "characters":
        characters.run()
    elif response == "membership_operators":
        membership_operators.run()
    elif response == "range":
        range.run()
    elif response == "reverse":
        reverse.run()
    elif response == "simple_for":
        simple_for.run()
    elif response == "nested_loop":
        nested_loop.run()
    elif response == "nesting":
        nesting.run()
    elif response == "ascii_while":
        ascii_while.run()
    elif response == "count":
        count.run()
    elif response == "factorial":
        factorial.run()
    elif response == "len":
        len.run()
    elif response == "simple_while":
        simple_while.run()
    elif response == "sum_100":
        sum_100.run()
    elif response == "sum_user_numbers":
        sum_user_numbers.run()
    elif response == "ascii_character":
        ascii_character.run()
    elif response == "ascii_code":
        ascii_code.run()
    elif response == "function_calls":
        function_calls.run()
    elif response == "function_with_loop":
        function_with_loop.run()
    elif response == "function_with_nesting":
        function_with_nesting.run()
    elif response == "function_with_parameter":
        function_with_parameter.run()
    elif response == "function_with_parameters":
        function_with_parameters.run()
    elif response == "multiple_functions":
        multiple_functions.run()
    elif response == "return_values":
        return_values.run()
    elif response == "simple_function":
        simple_function.run()
    elif response == "guess_the_number":
        guess_the_number.run()
    else:
        print("Invalid response! Please try again.")