laurent
Through 核桃编程Jason focused mainly on Scratch coding coding ( and that’s good )
Restaurants must be able to STORE food & PROCESS/COOK it. A storage space full of food is not a restaurant. A cook and his knives alone is not a restaurant. A skilled cook with access to food storage? Now we are talking!
Essentially a computer is a machine that can STORE and PROCESS information. Based on that definition & the things we discussed, please draw a computer
Ask the adults around you:
Try to help them answer the question just like we did during the class.
Which super-hero will you pick to control your computer? Will you pick the fastest (C)? Will you pick the cutest (Scratch)? Will you pic the most popular (Python)? It is not an easy question, and it does depend on your age and experience…
Next class we will write a simple hello.py to our beloved Python super-hero.
Ok let’s wrap up this lesson review. Please redraw your Big Picture from scratch
根据今天的反馈jason要用房间里的白板画出他脑海里的python big picture (要包含以下几项:
| python 英雄 | computer 电脑 |
| Store 存储 | Process 处理 |
| ML 机器语言 | Jason 编程人员 |
| Envelope 信封 | Letter (信封里的信) |
| StandardInput 标准输入 | python’s left hand |
| python’s right hand | Standard Output 标准输出 |
| Standard Error 标准错误 | print/say(显示) |
| return(返回) |
I can know that Jason has studied some Scratch. Hopefully he is able to take what he learned there into python. Here is a picture that shows the similarities between both languages:
Please put the following items within you BP
Attention: 重点在string, integer and float Jason should add his hello.py to his big picture making sure he uses variable declaration. 他要把他的hello.py 也画进去。 hello.py 文件里面不要乱用双引号和括号!
Jason, after our 2nd lesson I asked you and your parents how long and far you had been with Scratch. I think it is worth for you to try and connect what we do with scratch, so I have found some picture that illustrate how both languages do the same thing. I hope it helps.
图左是 Scratch 的表达方式, 图右是 Python 的语法。在 Scratch 中提问的结果会放入「答案」这个变数, Python 可以使用 input() 达>
图左是 Scratch 的表达方式, 图右是 Python 的语法。
图左是 Scratch 的表达方式, 图右是 Python 的语法。
图左是 Scratch 的表达方式, 图右是 Python 的语法。
图左是 Scratch 的表达方式, 图右是 Python 的语法。
图左是 Scratch 的表达方式, 图右是 Python 的语法。
图左是 Scratch 的表达方式, 图右是 Python 的语法。
图左是 Scratch 的表达方式, 图右是 Python 的语法。 Python 可以使用中文「分数」当作变数名称。
图左是 Scratch 的表达方式, 图右是 Python 的语法。 Python 可以使用中文「清单」当作变数名称。
Comments are section of your code that will not be executed by Python, they are typically there to explain what is happening (useful when you work with others). 确保对模块, 函数, 方法和行内注释使用正确的风格 Python中的注释有单行注释和多行注释. Python中单行注释以 # 开头,例如:
# the following code is a print statement print("Hello World, my name is Jason!")
多行注释如下:
''' The code below is a simple print statement. I am giving python a string of characters, and I ask python to send it (to print it, to display it) onto the standard output (typically the standard output is the screen) ''' print("Hello World, my name is Jason and I am a coder")
We talked about variables already. I said that variables are like labeled/named boxes that contain data. check the code below, and guess what python will do when it read it line by line:
jason_age = 10 jason_best_friend = "Milo" jason_birth_year = 2020 - jason_age print(jason_age) print(jason_best_friend) print(jason_birth_year)
Within the section about comments we asked python to print “Hello World, my name is…”. Although it is correct, each time we can put data in a box and give that box a name we should do it…so let’s do it!
hello = "Hello World, my name is Jason and I am coder". byebye = "It was a pleasure to meet you, see you soon" print(hello) print(byebye)
Here is the code we looked at during the class. You asked me:
We will solve all those mysteries but for now please read the code below outloud, look at the different colors, and commit line 13,15 and 17 to memory (write those 3 lines 20 times!