1.
Generators
def simpleGen():
yield 1
yield '2--->punch!'
myG = simpleGen()
'''
myG.next()
myG.next()
myG.next() #Exception
'''
for eachItem in simpleGen():
print eachItem,
print '-----------------------------------------'
from random import randrange
def randGen(aList):
while len(aList) > 0:
yield aList.pop(randrange(len(aList)))# Just like list.pop() and random.choice()
for item in randGen(['rock', 'paper', 'scissors']):
print item
2.
import longmodulename
short = longmodulename
del longmodulename
from cgi import FieldStorage as form
3.
1617042123[……]