python logo

Print Formatting

There are several ways to output the result using print() apples_in_basket = "111" print("There are " + apples_in_basket + " apples in the basket") print("There are",apples_in_basket,"apples in the basket") print("There are {}apples in the basket".format(apples_in_basket)) print(f"There are {apples_in_basket}apples in the basket")

February 11, 2022 · 1 min · Kei