2018-07-24 Chapter 2.2 Sample Data Type

2.2簡單數(shù)據(jù)類型
將數(shù)字作為字符串輸出
age = 23
message = "Happy " + str(age) + "rd Birthday!"
print(message)

加減乘除
print(5 + 3)
print(15 - 7)
print(2 * 4)
print(56 / 7.0)

temp = 33
print(temp)

Tip:

import this
Beautiful is better than ugly.
Explicit is better than implicit.
Simple is better than complex.
Complex is better than complicated.
Flat is better than nested.
Sparse is better than dense.
Readability counts.
Special cases aren't special enough to break the rules.
Although practicality beats purity.
Errors should never pass silently.
Unless explicitly silenced.
In the face of ambiguity, refuse the temptation to guess.
There should be one-- and preferably only one --obvious way to do it.
Although that way may not be obvious at first unless you're Dutch.
Now is better than never.
Although never is often better than right now.
If the implementation is hard to explain, it's a bad idea.
If the implementation is easy to explain, it may be a good idea.
Namespaces are one honking great idea -- let's do more of those!

最后編輯于
?著作權(quán)歸作者所有,轉(zhuǎn)載或內(nèi)容合作請(qǐng)聯(lián)系作者
【社區(qū)內(nèi)容提示】社區(qū)部分內(nèi)容疑似由AI輔助生成,瀏覽時(shí)請(qǐng)結(jié)合常識(shí)與多方信息審慎甄別。
平臺(tái)聲明:文章內(nèi)容(如有圖片或視頻亦包括在內(nèi))由作者上傳并發(fā)布,文章內(nèi)容僅代表作者本人觀點(diǎn),簡書系信息發(fā)布平臺(tái),僅提供信息存儲(chǔ)服務(wù)。

相關(guān)閱讀更多精彩內(nèi)容

  • rljs by sennchi Timeline of History Part One The Cognitiv...
    sennchi閱讀 7,854評(píng)論 0 10
  • **2014真題Directions:Read the following text. Choose the be...
    又是夜半驚坐起閱讀 11,119評(píng)論 0 23
  • 玉壺存冰心,朱筆寫詩魂。 諄諄如父語,殷殷似至親。 寥寥數(shù)行字,濃濃一生情。 厚望莘莘子,功成報(bào)師尊。 注1:近日...
    亮靚_27d5閱讀 516評(píng)論 20 35
  • 第一次聽說斜杠青年,是從星姐(特立獨(dú)行的貓)那里知道的,她寫了一篇《為什么我不主張上班都上不好的人,追求做斜杠青年...
    大麥07閱讀 643評(píng)論 0 7
  • 好友姚迪大學(xué)畢業(yè)1年了,一直沒有找到合適的工作。她本身是學(xué)傳媒的,按道理應(yīng)該往出版社或者廣播、電視媒體這個(gè)方向去找...
    認(rèn)真霸氣妮閱讀 315評(píng)論 0 0

友情鏈接更多精彩內(nèi)容