-->
当前位置:首页 > 题库

PROGRAMMING:JMU Python string exception handling

Luz5年前 (2021-05-10)题库404
Input a line of string and subscript to get the corresponding characters. The program can deal with the illegal data.
###Input format:
-Line 1: enter a string
-Line 2: enter the character subscript
###Output format:
-Subscript is not numeric exception, output 'subscript to integer`
-Subscript out of bounds`
-If the data is correct, output the character corresponding to the subscript
###Input example:
```in
python
one
```
###Output example:
```out
y
```
###Input example:
```in
python
a
```
###Output example:
```out
The subscript should be an integer
```
###Input example:
```in
python
ten
```
###Output example:
```out
Subscript out of bounds
```







answer:If there is no answer, please comment