赞
踩
age = int(input(“Please input your age:”))
name = input(“Please input your name:”)
print(“Ok,your name is %s, and your age is %d.” % (name, age))
当然,也不是说这种方式不能用,但是我们有一种更加直观并且方便的用法--print(F”“)以下是改进后的代码。
age = int(input(“Please input your age:”))
name = input (“Please input your name:”)
print(f “Ok,your name is {age}, and your age is {name}.” )
这样写的话是不是比较方便,但一定要记住引号前的 f 一定不能忘记。
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。