Let's get started.

I have some questions for you.

1. What's the difference between need and want?
2. Do you think English is useful for your professional learning?

The computer cannot work now, I have to find a professional (insider) to repair (fix) it.

I have said I will call the roll before class to figure out whether everyone is here. 

Actually it's a problem of descipline. We know that nothing can be done without descipline.

A person without self-descipline has no hope to make progress in his study, life and work.

For example, if you can get up at six and do morning exercise no matter what happens, 

then I can say that you're a person with self-descipline.


No self-descipline, no true progress!


The above is just random talk. But now let's get down to the point.

Start command-line Python.


What will you do If I require you to display two lines of string on the screen using only one print funciton?

We have to use the escape character: '\n'
What does n mean in the escape character '\n'?

Here, 'n' stands for "new line". 

We can use the escape character '\n' to move the cursor to the beginning of the next line.

Now we practice it in Python.


Is there any other way to get the same effect?


Actually, we can get the same effect in other programming languages.

(1) VB


(2) Java


(3) VFP


(4) JavaScript


(5) C


Now let's do addition.

Assign 100 to the variable a; (a is an int variable)

Assign 150 to the variable b; (b is an int variable)

Let sum equal a plus b. Or you can say like this:

Assign the result of the expression of a + b to the variable sum.

Print the the value of the variable sum.




This is just like what VB does. Let's have a look.

VB has two ways to solve this probem. Let me demonstrate them for you.



Please take a look at this error:


Tell me what you will do to kill this error. 

If we use this expression in JavaScript, what will happen? Let me give it a try.

No error! Why? JavaSript is a weak-type language, so it will automatically convert integer to string.


+: add, addition, plus
-: subtract, subraction, minus
×: multiply, multiplication, times
÷: divide, division, divided byLet's see some explames.3+2=5  Daily English: If you add two to three, you will get five.Math English: Three plus two equals five. / Three plus two is equal to five.5-3=2Daily English: If you subtract three from five, you will get two.Math English: Five minus three equals two. / Five minus three is equal to two.3×2=6Daily English: If you multiply three by two, you will get six.Math English: Three times two equals six. / Three times two is equal to six.6÷3=2Daily English: If you divide six by three, you will get two.Math English: Six divided by three equals two. / Six divided by three is equal to two.

We can use type function to get the type of data in Python.


Of course we cannot add an int to a str.  

We have to do the conversion from int to str or from str to int.

Let's take a look at the example.

1. conversion from str to int  -- to do addition


2. conversion from int to str -- to do connection


Actually, VB can do these two conversions.


Can JavaScript do these two conversions?


Open the page in Chrome browser, nothing displays but an error occurs.


The error is that val function is not defined in JavaScript.

Search the Internet and figure out whether there's a built-in JavaScript function to do the conversion from string to integer. 

OK, you have found the function: parseInt(). Let me give it a try.


The webpage looks like this:


We can use the function parseFloat to convert a string to a float number.


Search the Internet, you can find only two functions which start with "parse" in JavaScript: parseInt() and parseFloat().

A student just told me another function Number() that can convert a string to a number. 

The number can either be an integer or a real number. That's great! Let's practice it! 



Now we can conclude from the above practice that the function Number() can replace parseInt() and parseFloat() functionally.

Relation1: Teacher -- Student (many-to-many)
Relation2: Master - Desciple (many-to-many)What's the difference between these two relations?

老师学生——师父徒弟。

教——teach

带——guide, lead

All roads lead to Rome.

There is a good introductory book about Python programming that I want to recommend to you.


Python速成课程

容易上手,基于项目

从入门到实践

Task: Translate the following passage into Chinese.

That's great that the author began to write programs at age of five. 

Task: Translate the following passage into Chinese.

From the above passage, we know the author has a patient father.

This book is divided into two parts: BASICS and PROJECTS. 

There are eleven chapters in the first part and there are three projects in the second part.





After we get to know the structure of this book, we should dive into the book to start the journey of learning Python. 

First let's take a look at the INTRODUCTION of this book.


作者小时候学习编程的条件:一个主板+一个键盘+一个阴极射线管==>简陋的电脑

Let's have a look at the Jobs' APPLE I.



When two numbers are compared, there are three possible results.

the first result: number1 > number2  (number1 is greater than number2, >)

the second result: number1 == number2 (number1 is less than number2, <)

the third result: number1 < number2 (number1 is equal to nubmer2)


How can we make the "<Space War>" display on the page? 

OK, we have to use &gt; to replace ">" and &lt; to replace "<".


Relational operators will be used when two numbers are compared.

There are six relational operators in Python: ==、!=、>、>=、<、<=

==:  equal to

!=: not equal to

>: greater than

>=: greater than or equal to

<: less than

<=: less than or equal to


Next time, we will try to write the number-guessing game.

专业英语笔记(Line Feed and Type Conversion)相关推荐

  1. 专业英语笔记:Install and Use Python

    专业英语笔记:Install and Use Python Python was created in 1991. It has been espcially popular in recent ye ...

  2. 专业英语笔记:三次信息化浪潮

    Review on What We've Learned It's not what you learn but how you learn that matters. 学习内容不是最重要的,关键是学 ...

  3. 专业英语笔记:Spring框架

    Now we're learning Spring. The best way to learn Spring is to study its official documentation. The ...

  4. 计算机专业英语 读书笔记

    告诉大家一个好消息,我终于要做程序员了.成功从一个本科园艺植物学的学生跨考成为计科学硕.所以我决定恶补下计算机专业英语. 选了本书,打算阅读.翻译.后续读书笔记也会更新在博客里. 卜艳萍.周伟老师编著 ...

  5. Simulink Data Type Conversion模块使用笔记

    Data Type Conversion 是建模很常用的数据转换模块,在这里我想介绍一下在模型定标过程中Vonvert模块使用心得. 1.Output data type 这里设置的是Convert输 ...

  6. 计算机专业英语课外笔记,手帐 | 有了这份笔记后 我终于爱上了英语

    每个人应该都会有一个死角,会让自己感觉无能无力. 长这么大,让我感觉最无力的就是英语了,因为懒. 虽然不学英语也能工作.也能好好生活. 但是,人总要自虐一下,要不然生活哪里有那么多的乐趣和新鲜感呢? ...

  7. 笔记error: expected constructor, destructor, or type conversion before ‘.‘ token

    error: expected constructor, destructor, or type conversion before '.' token 找了半天原因,原来是犯了基础知识不扎实的错误, ...

  8. 遥感相关专业英语词汇汇总

    对网络上英语专业词汇进行汇总整理,如下表: 序号 英语基础词汇 摄影测量与遥感专业英语词汇 英语基础词汇 英语基础词汇-生态环境与遥感 1 Absorbed photosynthetically ac ...

  9. 计算机专业英语外文翻译,计算机专业英语JAVA介绍外文翻译[共28页]

    <计算机专业英语JAVA介绍外文翻译[共28页]>由会员分享,可在线阅读,更多相关<计算机专业英语JAVA介绍外文翻译[共28页](28页珍藏版)>请在读根文库上搜索. 1.荆 ...

最新文章

  1. android 实现全屏代码
  2. Windows、VMware、Linux及开发板间的网络连接
  3. 利润1000亿元:靠的是游戏,广告和微信,你怕了吗
  4. linux 串口工具_Zynq下linux系统搭建
  5. Linux资料分享,强势来袭!
  6. Matlab里evalin和assignin的用法
  7. linux实验试题 cp,cp命令实验,cp命令
  8. python极简应用_30个Python常用极简代码,拿走就用
  9. [LINUX] 误删了/lib 怎么办?
  10. RocketMQ 延时消息的使用和延时级别的配置
  11. 安全彻底的卸载工具App Cleaner Uninstaller for Mac
  12. java-如何反编译
  13. spring-speed-up.xml
  14. 使用lua脚本开发wow插件(魔兽世界插件开发)
  15. 字符分割函数strtok
  16. 计算机桌面应用程序图标不见了怎么办,桌面程序图标不见了,桌面软件快捷方式不见了怎么办?...
  17. 基于LSTM的短期股票预测
  18. mac android 文件管理器,PC和Mac浏览安卓手机上文件最快的方式,只需两步
  19. 真正程序员的工资是怎样的?
  20. 大数据下的用户画像标签去重

热门文章

  1. NVDLA软件架构和源码解析 第一章—内核驱动
  2. 金域与华为云联合AI辅助宫颈癌筛查技术创出国际最高水平
  3. mysql表的级联操作_mysql表之间的关系及级联操作
  4. 虚拟服务器dhcp,虚拟服务器上配置dhcp服务器
  5. Kotlin学习笔记 第四章注解
  6. 红橙Darren视频笔记 代理模式 动态代理和静态代理
  7. Python引用任意位置模块方法总结
  8. idea项目没法继承httpservlet_SpringBoot项目发布为war
  9. 连接路由器后电脑连不上网_猫、路由器、交换机的区别
  10. windows下如何解决intellij idea控制台中文乱码