請撰寫一程式,要求使用者輸入一字串,顯示該字串每個字元的索引。
範例輸入:
Sandwich
範例輸出:Index of 'S': 0
Index of 'a': 1
Index of 'n': 2
Index of 'd': 3
Index of 'w': 4
Index of 'i': 5
Index of 'c': 6
Index of 'h': 7
Sandwich
範例輸出:Index of 'S': 0
Index of 'a': 1
Index of 'n': 2
Index of 'd': 3
Index of 'w': 4
Index of 'i': 5
Index of 'c': 6
Index of 'h': 7
Kingdom
範例輸出:ASCII code for 'K' is 75
ASCII code for 'i' is 105
ASCII code for 'n' is 110
ASCII code for 'g' is 103
ASCII code for 'd' is 100
ASCII code for 'o' is 111
ASCII code for 'm' is 109
713
learning python is funny
範例輸出:LEARNING PYTHON IS FUNNY
Learning Python Is Funny
Many foreign students study in FJU
範例輸出:study in FJU
python
範例輸出:|python |
| python |
| python|
Our country is beautiful
u
範例輸出:u occurs 4 time(s)
-2 34 18 29 -56
範例輸出:Total = 23
Average = 4.6
329-48-4977
範例輸出1:Valid SSN
39Gfjkd98
範例輸出1:Valid password