專業英語筆記(Line Feed and Type Conversion)

      網友投稿 777 2022-05-29

      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.

      專業英語筆記(Line Feed and Type Conversion)

      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 by Let'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=2 Daily 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=6 Daily 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=2 Daily 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 "" display on the page?

      OK, we have to use > to replace ">" and < 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.

      版權聲明:本文內容由網絡用戶投稿,版權歸原作者所有,本站不擁有其著作權,亦不承擔相應法律責任。如果您發現本站中有涉嫌抄襲或描述失實的內容,請聯系我們jiasou666@gmail.com 處理,核實后本網站將在24小時內刪除侵權內容。

      上一篇:一個HBase MultiActionResultTooLarge的問題分享
      下一篇:數據結構域算法系列之二 貪婪算法和人生規劃
      相關文章
      亚洲国产精品线观看不卡| 亚洲国产精品成人AV无码久久综合影院| 在线精品自拍亚洲第一区| 亚洲人成网站在线观看播放动漫| 亚洲av无码一区二区乱子伦as| 亚洲中文字幕伊人久久无码| 亚洲成?Ⅴ人在线观看无码| 国产精品亚洲二区在线| gogo全球高清大胆亚洲| 国产亚洲综合久久| 亚洲AV无码成人精品区狼人影院| 波多野结衣亚洲一级| 亚洲情A成黄在线观看动漫软件 | 亚洲午夜一区二区电影院| 亚洲综合免费视频| 久久亚洲AV成人无码| 亚洲视频在线观看不卡| 亚洲成人福利在线| 亚洲人成图片网站| 亚洲av无码成人精品国产| 久久久久亚洲国产AV麻豆| 亚洲国产成人VA在线观看| 亚洲午夜AV无码专区在线播放 | 亚洲国产人成中文幕一级二级| 99亚洲男女激情在线观看| 国产亚洲精品第一综合| 亚洲另类少妇17p| 亚洲人成影院在线无码按摩店 | 亚洲avav天堂av在线网毛片| 亚洲欧美在线x视频| 国产亚洲视频在线| 亚洲人成色77777| 久久精品国产亚洲av成人| 精品无码一区二区三区亚洲桃色| 亚洲美女色在线欧洲美女| 亚洲宅男精品一区在线观看| 亚洲精品乱码久久久久久蜜桃图片| 99亚洲精品卡2卡三卡4卡2卡| 久久久久国产亚洲AV麻豆| 亚洲熟妇无码乱子AV电影| 亚洲中文字幕伊人久久无码|