File tree 3 files changed +21
-5
lines changed
3 files changed +21
-5
lines changed Original file line number Diff line number Diff line change 3
3
## sublime插件
4
4
* [ SublimeREPL] ( https://github.com/wuub/SublimeREPL ) 允许你在编辑界面直接运行 Python 解释器;以及执行python文件。
5
5
6
- ## 资源
6
+ ## 代码规范
7
+ * http://ssv.sebug.net/Python_Coding_Rule
8
+ ## 学习资源
9
+ * [ 简明 Python 教程] ( http://sebug.net/paper/python/index.html )
7
10
* [ crossin的编程教室] ( http://crossin.me/forum.php?mod=forumdisplay&fid=2 )
8
11
* [ dive into python] ( http://www.diveintopython.net/toc/index.html )
9
12
* [ learn python the hardway] ( http://learnpythonthehardway.org/book/ )
Original file line number Diff line number Diff line change 1
1
#!/usr/bin/python
2
2
#coding:utf-8
3
3
#上面两行是解决文件中 中文的问题
4
- print 'python is so cool~' ;
5
4
print 'why do you think python is cool?' ;
6
5
answer = raw_input ();
7
- print 'your answer is ' ;
8
- print answer ;
9
- print ' is so cool~'
6
+ print 'your answer is: ' , answer , ' is so cool~' ;
Original file line number Diff line number Diff line change
1
+ #!/usr/bin/python
2
+ #coding:utf-8
3
+ from random import randint
4
+ num = randint (1 , 10 );
5
+ # print num;
6
+ answer = int (raw_input ('输入一个数字: ' ));
7
+ while True :
8
+ if num == answer :
9
+ print '猜对啦' ;
10
+ break ;
11
+ elif answer > num :
12
+ print '猜大啦~'
13
+ else :
14
+ print '猜小啦' ;
15
+
16
+ answer = int (raw_input ('输入一个数字: ' ));
You can’t perform that action at this time.
0 commit comments