how to print a string and a float in python code example

Example 1: print decimal formatting in python

a_float = 3.14159
formatted_float = "{:.2f}".format(a_float)

Example 2: How do you print a integer in python

x = 7
print('Number: ' + str(x))
#str() turns anything inside to a string which allows you to
#add it to another/different string

Example 3: how to print float and string in single line python

#Let the balance be a float number
  bank_account_balance = 1234.54
  print("Bank Account Balance: " + str(bank_account_balance))