String formatting,stringformatting,num = 1 / 3.
String formatting,stringformatting,num = 1 / 3.
num = 1 / 3.0print '%e' % num # string formattingprint '%2.2f' % num # string formatting
相关内容
- Formatting example:center, rjust, ljust,rjustljust,string1 = 'N
- Generators,,def reverse(
- Draw rectangle with filled color,rectanglefilled,from Tkinter
- Printing ASCII,printingascii,i = 0while i
- Here are two ways to write a table of squares and cubes,squarescube
- Log print message into a file,logmessage,import syspr
- Use list as a stack: push onto stack,stackonto,L = []L.appe
- Zip three tuples,zipthreetuples,T1, T2, T3 =
- in a range,inrange,from math im
- apply function,apply,def func(x,
评论关闭