Python JavaScript String Subtraction
‘3’ - ’1’ = ‘3’ - ’1’ = 2 ‘3’ - ’1’ = Traceback (most recent call last): File "<pyshell#2>", line 1, in <module> ‘3’-’1’ TypeError: unsupported operand type(s) for -: 'str' and 'str'
A classroom comic compares Python and JavaScript while students try to calculate ‘3’ - ’1’. JavaScript-like code produces 2, but Python treats the quoted values as strings and throws a TypeError, joking about confusing programming languages and data types. It is used as a reaction to language-specific quirks or code that looks simple but fails. EN: A classroom comic compares Python and JavaScript while students try to calculate ‘3’ - ’1’. JavaScript-like code produces 2, but Python treats the quoted values as strings and throws a TypeError, joking about confusing programming languages and data types. It is used as a reaction to language-specific quirks or code that looks simple but fails.
classroom / классstudents / ученикиschool desks / школьные партыwhiteboard / доскаPython logo / логотип PythonJavaScript logo / логотип JavaScriptpaper answer sheet / лист с ответомnumber 2 / число 2code traceback / трассировка кодаshort-sleeved shirt / рубашка с короткими рукавамиseated student / сидящий ученик
- @gentoomemes / 4824 2023-06-05
- Type
- image
- Size
- 583×800 · 103.2 KiB
- Mood
- sarcastic, absurd
- Language
- en
- Added