Day2:How to use comments,octothorpe and variable in Python

Comment is a very important part in programing

Comments can tell you something does,and they also are used to disable parts of your program if you need remove them temporarily.

if you want comments in python,use'#'

     # In python,anything ignored after use '#'
     
     print "I want write this thing" #comment is ignored
     
     # print "这串不会执行"
     
     print "这会执行"
                    

Names and Variables

Variables is a thing to represent 'Something" in your code. Programmers use varibles to make code read more like English or other language.

     cake=50
     people=20
     tottal_cake_and_people = cake+people
     
     
     
     print "There have",cake,"cake to eat."
     print "We have",people," want to eat cake today."
     print "If everybody want to eat cake we need at least",tottal_cake_and_people,"cake"

<<:  进击的软件工程师之路-软件战斗营 第二周

>>:  {CMoney战斗营} 的第二周 #多型与介面

勒瑰恩谈写作 (3) 饱满与跳脱

间接叙事 练习:迂回说故事 这一段的练习是探讨「如何在叙事过程中提供资讯」。例如说科幻小说,通常有一...

[Day 2] SRE - 你的服务死後不要让人担心嘛

graceful shutdown 在关闭服务前,在服务内部以做完该做的事情,使得服务得以善终。 在...

D9-(9/9)-八方云集(2753) 真正的水饺股

注:发文日和截图的日期不一定是同一天,所以价格计算上和当日不同,是很正常的。 声明:这一系列文章并无...

SEO排名陷入撞墙期?也许你该试试「语义搜索引擎优化」!

作者:Welly SEO 编辑部 想做好Google SEO排名,除了熟知SEO是什麽之外,还必须充...

[Day 28] Final Project (4/5) — 部署模型到 Google AI Platform

前情提要 昨天我们成功的让 App 在本机端运作,但按下 开始预测! 後却出现了错误: 这意味着虽然...