#!/usr/bin/python
for i in range(ord("A"),ord("Z")+1):
    print(chr(i))

ord函数将字符转换为整数显示,chr函数将整数转换为字符显示

结果:

python循环打印A-Z_python