# File: printend.py # show how to print things on the same line # this builds on the twoplustwo.py # # Matt Bishop, MHI 289I, Fall 2024 # # # first , see what happens with 2 print statements print("2 + 2 =") print(2 + 2) print('--------------------------') # # and we'll put the output on the same line print("2 + 2 = ", end='') print(2 + 2) print('--------------------------') # # and we'll stick something between them print("2 + 2 =", 2 + 2, end='') print(2 + 2) print('--------------------------') # # finally, another example of using "end" print("2 + 2 = ", end='>>>') print(2 + 2 + "<<<") print('--------------------------')