[ 每日一課】 Python官方文檔 1 -- 簡介

Python簡介:

1. 由 Guido van Rossum在1989年編寫的一個編程語言。優雅, 明確, 簡單。  

2. 適合開發網絡應用, 小工具

3. 解釋型語言, 沒有編譯和鏈接, 可以節省程序開發過程中的大量時間

4. 缺點: 速度慢, 不能加密。


Python 格式

縮進區分

單行註釋: #

編碼:  #-*- coding: utf-8 -*-


Python輸入/輸出

print("hello, world"),  print('hello, world')

print('this', 'is', 'a', 'new', 'world')

print(‘%s', %num)

input([prompt])


Notes:

1. Python 區分大小寫。

2. Python3.3以後, input()和raw_input()合併, If the prompt argument is present, it is written to standard output without a trailing newline. The function then reads a line frominput, converts it to a string  

3. 參數格式化輸出

  • #%x --- hex 十六進制
  • #%d --- dec 十進制
  • #%o --- oct 八進制
  • #%s --- 字符串
  • #%f --- float 浮點數



發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章