Chinaunix首页 | 论坛 | 博客
  • 博客访问: 398670
  • 博文数量: 199
  • 博客积分: 154
  • 博客等级: 入伍新兵
  • 技术积分: 1530
  • 用 户 组: 普通用户
  • 注册时间: 2011-03-14 08:43
文章分类

全部博文(199)

文章存档

2015年(101)

2014年(97)

2011年(1)

分类: Python/Ruby

2014-10-31 11:54:29

# -*- coding: UTF-8 -*-
'''
【程序87】
题目:回答结果(结构体变量传递)
1.程序分析:     
2.程序源代码:
'''
if __name__ == '__main__':
    class student:
        x = 0
        c = 0
    def f(stu):
        stu.x = 20
        stu.c = 'c'
    a= student()
    a.x = 3
    a.c = 'a'
    f(a)
    print (a.x,a.c)
阅读(1063) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~