回答編集履歴

3

修正

2018/01/14 09:28

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -1,6 +1,10 @@
1
1
  3.6で導入された[フォーマット済み文字列リテラル](https://docs.python.jp/3/reference/lexical_analysis.html#f-strings)が適していると思います。
2
2
 
3
3
  ```Python
4
+
5
+ x = int(input())
6
+
7
+ y = int(input())
4
8
 
5
9
  print(f'{x}+{y}={x+y}')
6
10
 
@@ -12,6 +16,10 @@
12
16
 
13
17
  ```Python
14
18
 
19
+ x = int(input())
20
+
21
+ y = int(input())
22
+
15
23
  print('{0}+{1}={2}'.format(x, y, x+y))
16
24
 
17
25
  ```

2

リンクの追加

2018/01/14 09:28

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -8,7 +8,7 @@
8
8
 
9
9
 
10
10
 
11
- 少し古いPython3.xをご利用の場合は、str.formatが適しているでしょう。
11
+ 少し古いPythonをご利用の場合は、[str.format](https://docs.python.jp/3/library/stdtypes.html#str.format)が適しているでしょう。
12
12
 
13
13
  ```Python
14
14
 

1

追記

2018/01/14 09:26

投稿

LouiS0616
LouiS0616

スコア35660

test CHANGED
@@ -1,7 +1,17 @@
1
- ある程度バジョンしい必要があります
1
+ 3.6で導入された[フォマット済み文字列リテラル](https://docs.python.jp/3/reference/lexical_analysis.html#f-strings)ると思います。
2
2
 
3
3
  ```Python
4
4
 
5
5
  print(f'{x}+{y}={x+y}')
6
6
 
7
7
  ```
8
+
9
+
10
+
11
+ 少し古いPython3.xをご利用の場合は、str.formatが適しているでしょう。
12
+
13
+ ```Python
14
+
15
+ print('{0}+{1}={2}'.format(x, y, x+y))
16
+
17
+ ```