Lesson one
来源:互联网 发布:电信4g网络也是cdma吗 编辑:程序博客网 时间:2024/04/29 04:49
Test1:Output the following contents with powershell.
1 print "Hello World!"2 print "Hello Again"3 print "I like typing this."4 print "This is fun."5 print 'Yay! Printing.'6 print "I'd much rather you 'not'."7 print 'I "said" do not touch this.'
firstly,我们要把上面这段代码通过文本编辑器(我用的是gedit,当然Windows自带的记事本也行)保存成.py的格式。
secondly,我们打开powershell,利用cd的命令打开你所保存的.py文件的文件夹,只有这样才能利用python来跑这段script。
finally,我们在光标处输入python (文件名).py再回车即可运行以上python脚步了。
Running result:
PS C:\Users\Admin\desktop> python ex1.py
Hello World!
Hello Again
I like typing this.
This is fun.
Yay! Printing.
I'd much rather you 'not'.
I "said" do not touch this.
Other topic:
- 让你的script再多打印一行。
- 让你的script只打印一行。
- 在一行的起始位置放一个 ‘#’ (octothorpe) 符号。它的作用是什么?自己研究一下。
Let's solve the problems!
1:可以在当前的.py文件中修改源代码在代码末尾加入一行print “ ”,这样running的result就会变成多打印了一行(总觉得不应该这么傻瓜样的操作,看以后深入学习了再来修改这里吧)
2:只用一个print
3:这个我们可以自己加的试试running一下。结果出来我们很容易知道#号的功能是注释,在哪一行前面加上#,这一行的内容将不会被打印出来
至此,我们的习题一就结束了。
0 0
- Lesson one:
- lesson one
- Lesson one
- Lesson Fifty-One
- Lesson one in career
- Lesson One(Machine Learning)
- STS lesson one : p
- Lesson One Excuse me. 对不起.
- Learning English - Lesson One (Introduction)
- Lesson 2 Thirteen equals one
- LearingWebGL Lesson one WebGL教程
- Android Lesson One: Getting Started
- 计算机英语(one Lesson)
- Lesson 2 Thirteen equals one
- Lesson one hundred thirteen Small change.
- Lesson one hundred thirty three Sensational news.
- IOS-C 语言 Lesson One 变量
- Lesson One:Android开发环境搭建
- Jenkins构建Android项目持续集成之单元测试及代码覆盖率
- UVA 10779 【maximum flow】
- js的性质和一些对象及属性
- tiny_cnn源码阅读(4)-convolutional_layer
- Android中汉字转换为拼音
- Lesson one
- 谈谈javascript语法里一些难点问题(一)
- 自定义el表达式函数
- c#设计模式-观察者模式
- 写在系列的开始
- 谈谈javascript语法里一些难点问题(二)
- mysql插入汉字是乱码或者问号的解决方法
- 关于C# DataGrid 双击获取或者更改双击单元格内容
- C++中模板的特化与偏特化