""" Ex. 4.6 from "A Primer on..." This is a slightly more advanced version than the exercise asks for. We use a while-loop to repeatedly ask for input and print the associated output, until the user types 'q'. """ while True: value = input("Provide some input ('q' to quit): ") if value == 'q': break #stop the loop result = eval(value) print(f'The result is {result}, with type {type(result)}') """ Terminal> python objects_qa.py Provide some input ('q' to quit): "test" The result is test, with type Provide some input ('q' to quit): 5 * 5 The result is 25, with type Provide some input ('q' to quit): [1,2,3] The result is [1, 2, 3], with type Provide some input ('q' to quit): q """