87_结构体变量传递
# 结构体变量传递
class Student:
x = 0
c = 1
def f(stu:Student):
stu.x = 20
stu.c = 'c'
a = Student()
print(a.x,a.c)
a.x = 1
a.c = 'b'
print(a.x,a.c)
f(a)
print(a.x,a.c)
# 结构体变量传递
class Student:
x = 0
c = 1
def f(stu:Student):
stu.x = 20
stu.c = 'c'
a = Student()
print(a.x,a.c)
a.x = 1
a.c = 'b'
print(a.x,a.c)
f(a)
print(a.x,a.c)