>>> name = input("name:") name:zhou >>> print("{}student,learn Python,furture!".format(name)) zhoustudent,learn Python,furture! >>> print("{}daxia,xuehaoPython,dazhanquanjiao! ".format(name[0])) zdaxia,xuehaoPython,dazhanquanjiao! >>> print("{}大侠,学好Python,嘻嘻哈哈! ".format(name[1:1])) 大侠,学好Python,嘻嘻哈哈! >>>
时间: 2024-11-05 11:23:27