3.11 random,calendar

Print (random.random ()) # is greater than 0 and less than a decimal between float. 1 
Print (random.uniform (l, 5)) # floating point number between 1-5 
Print (the random.randint (l, 4)) # [1,4] and the number between 1-4 can be taken to 
Print (random.randrange (1, 10,)) # care regardless of the tail, taking odd 
Print (the random.choice ([1,2, 3])) # randomly 
Print (random.sample ([ ' . 1 ' , 2,3,4], 3)) # randomly, returns a list, even if there is a tuple set, it will return a list of
= Li [I for I in Range (10 )] 
random.shuffle (Li) 
Print (Li) 
output: 
[ 1, 6, 0, 5, 3, 4, 9, 7, 2, 8]

calendar

Import Calendar 
CAL = Calendar.MONTH (2019,8 )
 Print (CAL) 
output: 
        August 2019 
of Mo Tu We Th Fr of Sa Su
           . 1 2. 3. 4 
 . 5. 6. 7. 8. 9. 11 10 
12 is 13 is 18 is 14 15. 17 16 
. 19 20 is 21 is 22 is 23 is 25 24 
26 is 27 28 29 30 31 is

 

Guess you like

Origin www.cnblogs.com/pythonblogs/p/11210693.html