0
0

More than 3 years have passed since last update.

指定範囲内のアルファベットの出力

Last updated at Posted at 2020-07-22

記録用

入力された文字列の最初と最後のアルファベットの範囲内のアルファベットを出力

chr()は整数値を文字に変換する関数。
ord()は文字を整数値に変換する関数。

65~90まで大文字、97~122まで小文字。

ex:ord('A') =65 ,chr(65) ='A'

入力例
GINO

出力例
G
H
I
J
K
L
M
N
O

コード
```
line = input()
n = len(line)

for i in range(ord(line[0]),ord(line[n-1]) + 1):
print(chr(i))
```

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0