python day one 變數,if

來源:互聯網
上載者:User

標籤:else   組成   單詞   區分大小寫   常量   if語句   name   語句   day one   

一、變數,常量

    變數:用於儲存和標記資訊在記憶體中,方便日後被調用、操作和修改

    常量:固定不變大的量。字母大寫

    命名規則:

    1、由字母數字底線組成,命名要有意義,區分大小寫。

    2、命名建議用底線分割單詞

 

二、if語句

    if、else、elif

a = 1b = 2if a<b :    print("a<b")else a==b:    print(‘a=b‘)else;    print(‘any’)

 

三、其他

    1、注釋

    #:單行注釋

    ‘‘‘單行注釋’’’

    “““多行注釋”””

    2、input:使用者輸入

input(‘you name:‘)

    3、拼接

ptint(“my name is”,“Alex”)#>>my name is     Alexprint("my name is"+"Alex")#>>my name is Alex

 

 

    

python day one 變數,if

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.