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

質問編集履歴

1

内容の追加

2018/12/20 13:30

投稿

pino_python
pino_python

スコア13

title CHANGED
File without changes
body CHANGED
@@ -10,6 +10,7 @@
10
10
 
11
11
  <python>
12
12
 
13
+ ```python
13
14
  import sys
14
15
  def moon_weight():
15
16
  print("how is your weight on the earth?")
@@ -26,6 +27,27 @@
26
27
  on_moon = first_weight * 0.165
27
28
  print("year=%s %s" % (year2 , on_moon ))
28
29
  moon_weight()
30
+ ```
31
+ トレースバック
32
+ ```
33
+ how is your weight on the earth?
34
+ Traceback (most recent call last):
35
+ File "<ipython-input-89->", line 1, in <module>
36
+ runfile('ファイル名')
29
37
 
38
+ File "", line 710, in runfile
39
+ execfile(filename, namespace)
30
40
 
41
+ File "/anaconda3/lib/python3.6/site-packages/spyder/utils/site/sitecustomize.py", line 101, in execfile
42
+ exec(compile(f.read(), filename, 'exec'), namespace)
43
+
44
+ File "ファイル名", line 24, in <module>
45
+ moon_weight()
46
+
47
+ File "ファイル名", line 11, in moon_weight
48
+ first_weight = int(sys.stdin.readline())
49
+
50
+ ValueError: invalid literal for int() with base 10: ''
51
+ ```
52
+
31
53
  よろしくおねがします。