質問するログイン新規登録

回答編集履歴

1

.

2019/04/13 07:47

投稿

tachikoma
tachikoma

スコア3601

answer CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  ```python
4
4
  item = dic.get("test")
5
- if item and len(item.strip()):
5
+ if item and item.strip():
6
6
  test = item
7
7
  else:
8
8
  print("error")
@@ -12,7 +12,7 @@
12
12
 
13
13
  ```python
14
14
  item = dic.get("test")
15
- if (item is not None) and (len(item.strip()) != 0):
15
+ if (item is not None) and (item.strip() != ""):
16
16
  test = item
17
17
  else:
18
18
  print("error")