| 
 | 
 
 
发表于 2019-12-17 10:55:24
|
显示全部楼层
 
 
 
- import random
 
 -     
 
 - def  image_I():
 
 -    print('image_I')
 
 -    
 
 - def  image_L():
 
 -    print('image_l')
 
 -    
 
 - def  image_J():
 
 -    print('image_j')   
 
  
- def  image_O():
 
 -    print('image_o')
 
  
- def  image_S():
 
 -    print('image_s')
 
  
- def  image_T():
 
 -    print('image_t')
 
  
- def  image_Z():
 
 -    print('image_z')   
 
 -    
 
 - lst=['image_I','image_L','image_J','image_O','image_S','image_T','image_Z']
 
 - eval(random.choice(lst)+'()')
 
 - eval(lst[random.randint(0,6)]+'()')
 
  
- '''
 
 - e:\pytest>python ex23.py
 
 - image_t
 
 - image_s
 
  
- e:\pytest>python ex23.py
 
 - image_z
 
 - image_l
 
  
- e:\pytest>python ex23.py
 
 - image_o
 
 - image_t
 
  
- e:\pytest>python ex23.py
 
 - image_j
 
 - image_z
 
  
- e:\pytest>python ex23.py
 
 - image_o
 
 - image_z
 
  
- '''
 
  复制代码 |   
 
 
 
 |