Python學習Day1

來源:互聯網
上載者:User

標籤:1.3   unp   點擊   執行   har   ++   學習   環境變數配置   nbsp   

1.配置Notepate++的python環境(在作業系統安裝Python的前提下)

(1) Notepad++ ->"運行"菜單->"運行"按鈕

(2) 在彈出的視窗內輸入以下命令:

cmd /k python "$(FULL_CURRENT_PATH)" & ECHO. & PAUSE & EXIT

然後點擊“儲存”,隨意取一個名字,比如“RunPython”,為方便,配置一下快速鍵(比如 Ctrl + F5),點OK即可。之後運行Python檔案只要按配置的快速鍵或者在運行菜單上點“RunPython 3.6”即可。

python:為環境變數配置的執行檔案的名稱

2、程式編寫

(1)hello word

print "hello,world"

(2)輸入輸出

代碼1:

a =int(input("A:"))b =int(input("B:"))c=a/bprint("sum:",c)

  輸出結果:

A:1B:3sum: 0.3333333333333333

代碼2:

a =float(input("A:"))b =int(input("B:"))c=a/bprint("sum:",c)

輸出結果:

A:1.3B:3sum: 0.43333333333333335

代碼3:

a =float(input("A:"))b =3c=a/bprint("sum:",c)

輸出結果:

A:3.2sum: 1.0666666666666667

 

Python學習Day1

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在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.