8th class notes

  1. 1.    The ternary operator

+

 

 

  1. 2.      for loop

for limited circulation, while infinite loop

 

 

 

Iterables: strings, numbers can not

 

 

 

But you can not use digital iteration range function

for i in range(100)

for I in range (0,100):

for I in range(0,100,1)

The three same wording, the default is not writing starting from 0, the default is a step

Also supports negative values

 

 

 

The default figures are generally from 0 to start it can range after parameter set ( 1 , 10 ) on the 1 start

 

 

 

If Range ( 2 , . 11 , 2 ) the second two are added to the start number of the first

 

 

 

If the following map, the range number in the print number of times

 

 

 

 

 

 

 

 

For loop circulation from top to bottom a top to bottom a print cycle output

 

 

 

 

 

 Example 99 multiplication table

 

 

  1. 3.     Pass : maintain the integrity of the code

 

 

 

Example: If do not want to print but does not print will be with gains across the board will pass

 

 

 

  1. 4.     Print the little mechanism

In print Riga end = "" to cancel wrap,

 

 

 

Guess you like

Origin www.cnblogs.com/peiw/p/11715654.html