I do not know why the output is like this!
I ran two almost identical programmes but the output changed. But I don't understand why the output changes.
I would like to know.
First Program
First output
Seccond Program
Seccond output
Using my environment
・MacOS
・Python3.12
・Poetry
・mojo 24.4.0 (2cb57382)
1 Reply
In the first, you've provided a type to the
name
argument (String
), whereas in the second you've left name
untyped. In the latter case, Mojo will default to object
for the argument in a def
function. This causes the slightly different printing behavior between the two types.