Python基礎

發現Python都忘得差不多了,簡單複習一下。

Install

  • anaconda
  • conda

Input

help(input)

name = input('what is your name? ')

Modules and Imports

Can use dir() to check the namespace difference.

import math
import math as fun
from math import pi, tan
from math import pi as pie, tan as tangent

Data Type

  • int
  • float
  • bool

Basic Math Functions

math
pi
e
isinf
isnan
factorial
log
exp
pow
sqrt
cos
acos
degrees
radians
acosh
asinh

Sequence Types

  • str
  • byte
  • bytearray
  • list
  • tuple
  • slicing

slice[start, stop, step]

Collection & Mapping

  • range
  • set
  • dict

Loops & Conditions

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