传送门:http://acm.hdu.edu.cn/showproblem.php?pid1288 Hats Tea Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 2127 Accepted Submission(s): 484 Problem DescriptionHat is a member of PG S…
变量作用域
case2:局部变量与全局变量同名
x"i am global var"
def fun():x100print(x)
fun()
print(x)
***********output************
100
i am global var
>>> 即便同名,函数内访问的变量就是函数内定义的局部var,函数外访问的就…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid1286 找新朋友 Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 14909 Accepted Submission(s): 7936 Problem Description新年快到了࿰…