进行两个变量的拼接:
first_name = "liu"
last_name = "dehua"
full_name = first_name +""+last_name
print(full_name.title())
#输出
Liudehua
进行运算式拼接:
day = 18
birthday = "2019"+str(day)+"3"
print(birthday)
#输出
2018183 #因为将day变量里面的数字转化为字符串进行相加
day = 18
birthday = "2019"+int(day)+"3"
print(birthday)
#输出
2039 #因为将day变量里面的数字转化为整数进行相加
day = 18.3
birthday = "2019"+float(day)+"3"
print(birthday)
#输出
2039.3 #因为将day变量里面的数字转化为浮点小数形式进行相加