# -*- coding: utf-8 -*-
print r'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
print r'''静夜思
床前明月光,
疑是地上霜。
举头望明月,
低头思故乡。'''
2016-01-14
int start=1;//起始项是1
int sum=1;//当只有一项时和为1
for(int l=1;l<=3;l++){
start=start+3;//获取每项的值
sum=start+sum;//将每项的值加到sum中去
}
System.out.println(sum);
int sum=1;//当只有一项时和为1
for(int l=1;l<=3;l++){
start=start+3;//获取每项的值
sum=start+sum;//将每项的值加到sum中去
}
System.out.println(sum);
2016-01-14
Python 3.4.3
>>> print ('\'\\"To be, or not to be\\": that is the question.\\nWhether it\\\'s nobler in the mind to suffer.\'')
'\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.'
别问我……我整个人都是奔溃的……
>>> print ('\'\\"To be, or not to be\\": that is the question.\\nWhether it\\\'s nobler in the mind to suffer.\'')
'\"To be, or not to be\": that is the question.\nWhether it\'s nobler in the mind to suffer.'
别问我……我整个人都是奔溃的……
2016-01-14
>>> print r'''''\'\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.\''''''
''\'\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.\'
''\'\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.\'
2016-01-14
Python 2.7.11
>>> print r'''\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.'''
\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.
>>> print r'''\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.'''
\'to be, or not to be\":that is the question.\nWhether it\'s nobler in the mind to suffer.
2016-01-14
1.x从1--100开始递增
2.判断x是否在100范围中
3.判断x是否为奇数
是:递加到sum变量中
否:跳过后面语句
2.判断x是否在100范围中
3.判断x是否为奇数
是:递加到sum变量中
否:跳过后面语句
2016-01-14
print [100*a+10*b+c for a in range(1,10) for b in range(0,10) for c in range(1,10) if a==c ]
2016-01-13
print [100*a+10*b+c for a in range(1,10) for b in range(0,10) for c in range(0,10) if (100*a+10*b+c)==(100*c+10*b+a)]
2016-01-13