Posts

Showing posts with the label Python

Python Learning

Website:  www.python.org Structure Input: variable Process: basic calculation, logical calculation Output: print, write to file, load into database Number and Math 18/7--> 2 18.0/7.0--> 2.5714285714285716 9%4--> 1 8**3 -->512 Function print(<variable>) / print <variable>: (integer, string, float) Example:  print(a) print x, y, z print(x,y,z) print(1) print(1.345) print("abc") Print format  print(format(<value>,'m.nf')) m: print length n: how many bits after point (>0) Example print(format(12.123456,'6,2f'))   12.12 Input str1=input(<message>): str1=input("please input value:") Len len(<variable>): len(a) Pow pow(2,3)-->8 <=> 2*2*2 <=> 2**3 abs abs(-18)-->18 Module import <module name> Example: import math math.floor(18.7)-->18 math.sqrt(4)-->2 also can give the module.function w...