公開:2025-06-02、更新:2025-06-02
9-2「エラーを見てバグを直す」 2ページ
マンガ

2
コンテンツ紹介
テキスト原稿
# 2p
__1__
```sh
Traceback (most recent call last):
File "C:\~\main.py", line 6, in
quotient = num1 // num2
~~~~~^^~~~~~
TypeError: unsupported operand type(s) for //: 'str' and 'str'
```
---
__2__
猫野:
前回のエラーの続きだ
まずTracebackは
さかのぼるという意味だ
ここには
パスや行数が
表示される
__3__
猫野:
表示が2つ以上
あるなら関数の
呼び出し元などを
たどっている
---
__4__
猫野:
ここでは
main.pyの
6行目に問題がある
というのが分かる
__5__
```sh
Traceback (most recent call last):
File "C:\~\main.py", line 6, in
quotient = num1 // num2
~~~~~^^~~~~~
TypeError: unsupported operand type(s) for //: 'str' and 'str'
```