题解 | #格式化输出(一)#
格式化输出(一)
https://www.nowcoder.com/practice/fe82dc48f4f04b2397a85fb1bdbe34a2
'''
方法一:f-string
name = input()
print(f'I am {name} and I am studying Python in Nowcoder!')
方法二:format()
name = input()
print('I am {} and I am studying Python in Nowcoder!'.format(name))
方法三:使用%格式化
name = input()
print('I am %s and I am studying Python in Nowcoder!'%name)
'''
查看30道真题和解析