Login
You're viewing the ruby.social public feed.
  • Nov 27, 2025, 10:28 PM

    @lig You `add()` example is probably one of the worst examples you could have come up with... because

    ```python
    def add(a, b):
    return a + b;

    print(add(15, 42));
    print(add(15, 42.6));
    print(add("hello", "world"));
    ```

    All work, so what does `add()` return? Eh idk depends on what you give it I guess? At least PHP would throw a TypeError in the 3rd case because concatenation doesn't use the same symbol as addition.

    💬 0🔄 0⭐ 5