Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
各文字をスペースで区切って、chr() を使用して 1 行にアルファベットを出力するにはどうすればよいですか。
私の現在のコード:
for x in range(97,123): letter = chr(x) alphabet = "" + letter print alphabet
import string print " ".join(string.lowercase)
またはchr、コメントに記載されているように、の使用が必須の場合:
chr
print " ".join([chr(c) for c in xrange(ord('a'), ord('z') + 1)])
,afterprintステートメントを使用して、
,
print
print alphabet,