In order to master the good Python This tool, now ready to consolidate the grammar base
1. Continue statements
# !/usr/bin/python # -*-coding:utf-8-*- n=100 while n > 0: n-=1 if n% 2 = = 0 :continue Print (n)
# n-=1 can not be put here, once encountered Continue,while into the next cycle and I value is not incremented
2.number
[email protected] python]$ cat day01_number_01.py#!/usr/bin/python#-*-coding:utf-8-*-ImportMath" "Changing the Number data type will reallocate storage space" "Print "ABS ( -18):", ABS (-18)Print "Math.ceil ( -4.1):", Math.ceil (-4.1)#cmp only used in Python 2.xPrint "CMP (80,100):", CMP (80,100)Print "Math.exp (100.12):", Math.exp (100.12)Print "Math.fabs ( -5):", Math.fabs (-5)Print "Math.floor ( -5.1):", Math.floor (-5.1)Print "Math.log (E):", Math.log (MATH.E)Print "Math.log (100,10):", Math.log (100,10)Print "math.log10 (+):", MATH.LOG10 (100)Print "Max (1,2,6,3.5,8):", Max (1,2,6,3.5,8)Print "math.modf (100.72):", MATH.MODF (100.72)Print "Math.pow (100,2):", Math.pow (100,2)
Python basic syntax