예제 #1
0
# _*_ coding: UTF-8 _*_

import external

if __name__ == '__main__':
    print external.add(10, 20)
예제 #2
0
# -*- coding:utf-8 -*-
# @Author: Marie
# @Time:  2018/10/18 8:20 PM
# @Software: PyCharm
import external as ex
if __name__ == '__main__':
    print(ex.add(10, 20))
예제 #3
0
파일: 1.py 프로젝트: osatmnzn/python
    inst = Num()
    for i in range(3):
        nNum += 1
        print 'The num = %d' % nNum
        inst.inc()
'''
【程序44】
题目:学习使用external的用法。
1.程序分析:
2.程序源代码:
external.py代码:

'''
import external
if __name__ == '__main__':
    print external.add(10,20)
'''
【程序45】
题目:学习使用register定义变量的方法。
1.程序分析:
2.程序源代码:
没有register关键字,用整型变量代替
'''
tmp = 0
for i in range(1,101):
    tmp += i
print 'The sum is %d' % tmp
'''
【程序46】
题目:宏#define命令练习(1)   
1.程序分析:
예제 #4
0
파일: py44.py 프로젝트: Symbian9/pycoder
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# @Author: anchen
# @Date:   2016-03-16 16:16:14
# @Last Modified by:   anchen
# @Last Modified time: 2016-03-16 16:16:45

import external

if __name__ == '__main__':
    print(external.add(10, 20))