While working on the physics project I wondered what’s the difference between these two ways of printing different data types, in this case string+int or float. Which one is better and why?
print("The GE train supplies " + str(train_force) + " Newtons of force.") print("The GE train supplies", train_force, "Newtons of force.")
I only discovered that when using comma there is no need to add extra spaces and to convert the int to str.