savings = 100
result = 100 * 1.10 ** 7
print("I started with $" + savings+ " and now have $" + result+ " Awesome!")
pi_string = "3.1415926"
答案 0 :(得分:-1)
您可以将int
s转换为str
s,如下所示:
print("I started with $" + str(savings)+ " and now have $" + str(result)+ " Awesome!")
或使用这样的字符串格式:
print("I started with ${} and now have ${} Awesome!".format(savings, result))