b import 了 a, c import 了 b,c 中也会有定义test.py 1 __all__ = ['a', 'b'] 2 3 def a(): 4 print "a" 5 6 def b(): 7 print "b" 8 9 def c():10 prin...
分类:
编程语言 时间:
2014-09-10 09:33:00
阅读次数:
204
需求:gz=int(raw_input(‘请输入您收入/月:‘))
F=file(‘commodity.txt‘)
shop_list=[]
product=F.readline()
products=product.split()
products_prices=F.readline()
prices=[int(i)foriinproducts_prices.split()]
min_prices=min(prices)
whileTrue:
print‘本商店提供..
分类:
其他好文 时间:
2014-09-10 02:56:01
阅读次数:
249
执行脚本absolute.py # print absolutle values of an integera = raw_input()if a>0: print aelse: print -a输入-100得到的结果为C:\Users\5 one>python absolute.py-1...
分类:
编程语言 时间:
2014-09-09 23:00:19
阅读次数:
265
1.创建一个Printer接口interface Printer{ public void open(); public void print(String s); public void close();}2.创建一个PrinterFactory类public class Pri...
分类:
移动开发 时间:
2014-09-09 20:02:09
阅读次数:
218
Java数组输出
Java 数组输出一般都是用循环输出,例如(code1):
int[] arr = new int[10];
for (int i = 0; i < arr.length; i++) {
System.out.print(arr[i]);
}
但是,对于 char[] 类型的数组,可以使用一条输出语句输出,例如(code2):
char[] chs...
分类:
编程语言 时间:
2014-09-09 18:29:49
阅读次数:
234
首先我们通过网友在stackoverflow关于python super类的一个疑问来作为本篇的开始,问题大致是这样的:>>> class A(object):... def __init__(self):... print "A init"... ...
分类:
编程语言 时间:
2014-09-09 17:33:59
阅读次数:
189
#include
#include
#include
using namespace std;
void print(int n)
{
for(int i=0;(1<<i)<=n;i++)
if(n&(1<<i))
cout<<1;
else cout<<0;
cout<<endl;
}
int main()
{
i...
分类:
其他好文 时间:
2014-09-09 16:03:59
阅读次数:
220
一、定义变量--简单赋值 declare @a intset @a=5 print @a --使用select语句赋值 declare @user1 nvarchar(50) select @user1='张三'print @user1 declare @user2 nvarchar(50) s.....
分类:
数据库 时间:
2014-09-09 15:57:58
阅读次数:
267
1. 定义委托 public delegate void GreenPeople(string name);2. 声明方法 public static void ChinesePeople(string Name) { Console.WriteLine("你好," + Name); } publi...
分类:
其他好文 时间:
2014-09-09 15:50:48
阅读次数:
147
if(@ARGV!=2){
die "Usage: $0 sample_file sample_number\n";
}
my($sample_file, $sample_number) = @ARGV;
open my $FILE, "
my @content = ;
my $all_number = @content;
#print "|$all_number|\n";...
分类:
其他好文 时间:
2014-09-09 12:33:48
阅读次数:
351