回答編集履歴
2
空白区切りの場合を追記
answer
CHANGED
@@ -2,6 +2,14 @@
|
|
2
2
|
|
3
3
|
```python
|
4
4
|
x = input('Please enter a string:')
|
5
|
-
x = x[-1] + x[:-1]
|
5
|
+
x = x[-1:] + x[:-1]
|
6
6
|
print(x)
|
7
|
+
```
|
8
|
+
|
9
|
+
空白で区切るなら split してから。
|
10
|
+
|
11
|
+
```python
|
12
|
+
x = input('Please enter a string:').split()
|
13
|
+
x = x[-1:] + x[:-1]
|
14
|
+
print(*x)
|
7
15
|
```
|
1
コード変更
answer
CHANGED
@@ -2,6 +2,6 @@
|
|
2
2
|
|
3
3
|
```python
|
4
4
|
x = input('Please enter a string:')
|
5
|
-
x = x[-1
|
5
|
+
x = x[-1] + x[:-1]
|
6
6
|
print(x)
|
7
7
|
```
|