使用%s 替代之前的变量 a = ('uHhad') a1 = a.capitalize()#shou字母大写 a5 = '和第a1相同%s'%(a1) print(a,a1,a5) 把之前的变量代入新创建的变量当中