Add
What is the result of this code in Perl / Python / Rust?
examples/python-types-at-pyweb-2025-01/add.rs
fn main() { println!("ok"); println!("{}", "19" + 23); }
examples/python-types-at-pyweb-2025-01/add.py
print("ok") print("19" + 23)
examples/python-types-at-pyweb-2025-01/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.