Python 練習(xí)實(shí)例87

python 練習(xí)實(shí)例87

python 編程100例python 編程100例

題目:回答結(jié)果(結(jié)構(gòu)體變量傳遞)。

程序分析:無。

程序源代碼:

#!/usr/bin/python
# -*- coding: utf-8 -*-

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

以上實(shí)例輸出結(jié)果為:

20 c

python 編程100例python 編程100例

下一節(jié):python 練習(xí)實(shí)例88

python 編程100例

相關(guān)文章
亚洲国产精品第一区二区,久久免费视频77,99V久久综合狠狠综合久久,国产免费久久九九免费视频