Which line causes a TypeError? python num1 = 10 num2 = "5" result = num1 + num2
- num2 = "5"
- result = num1 + num2
- num1 = 10
- None of them
Answer
B) result = num1 + num2
Python can't add an int and a str. Fix: num1 + int(num2). SLO CS-11-C-02 · Understanding
Computer Science MCQ · More Unit 3: Programming Fundamentals MCQs · Practise