Coggle requires JavaScript to display documents.
PythonSyntax
for index,item in enumerate(a): print(index+1,item)
try: except IOError as e: print('Error:', e)
try: Normal execution block except A: Exception A handle except B: Exception B handle except: Other exception handle else: if no exception,get here finally: exec here, anyway. print("finally")
g=100 print(g) def f(): #global g g=2 print('in function:',g) f() print(g)
def f(): for i in range(26): print(chr(ord('A')+i)) import time time.sleep(1) yield alpha=f() for i in range(20): print('call next') next(alpha)
import sys sys.path.insert(1,'wsgipython') module=__import__('ctime') f=getattr(module,'print_time') f()
@classmethod
self.xx