Add
What is the result of this code in Perl / Python / JavaScript / Rust?
examples/python-types-at-pyweb-2025-05/add.rs
fn main() { println!("ok"); println!("{}", "19" + 23); }
examples/python-types-at-pyweb-2025-05/add.py
print("ok") print("19" + 23)
examples/python-types-at-pyweb-2025-05/add.js
console.log("ok"); console.log("19" + 23);
examples/python-types-at-pyweb-2025-05/add.pl
use feature 'say'; say "ok"; say "19" + 23;
rustc add.rs
- The Rust code will have a compilation error.
- The Python code will have a runtime exception.
- The Perl code will print the correct answer: 42.
Howeever, in these example the problem is in-front of us. We can easily see it.