Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

THREE QUESTIONS - USE PYTHON LANGUAGE 1. Copy the function definition below. Add

ID: 3729842 • Letter: T

Question

THREE QUESTIONS - USE PYTHON LANGUAGE

1. Copy the function definition below. Add the appropriate terminating condition to the while loop to make the loop stop if the user enters a 'q'.

----------------------------------------------------------------------------

def process_commands():

      is_done = False
    
      while __________ :

            response = input("Enter a command or type 'q' when to quit: ")
            if response == 'q':
                  is_done = True
                  print("Good-bye")
            else:
                  print(response)

2. Write a boolean function called return_bool that accepts one parameter of data type str and returns True if the value passed to this function is equal to "True" otherwise it should return False.

For example:

3. Define a function called calculateTip that accepts one numeric parameter and returns a float value equal to 20% of the input value.

Test Result print(return_bool("True")) True print(return_bool("False")) False

Explanation / Answer

1.

2.

3.