python | julia | comment | |
---|---|---|---|
print(1, 2) |
π€¦ββοΈ println(1, " ", 2) |
why I need to type ln ? |
|
slicing | π a[::2] |
π€¦ββοΈ a[1:2:end] |
too verbose (start/stop must be given) |
π€¦ββοΈ sin.(a) .- 1 |
silly dot | ||
func def | π f(x) = 2*x |
||
complex numbers | π 1j |
1im |
|
π 2x |
π€¦ββοΈ 0x syntax: invalid numeric constant "0x" |
||
π€¦ββοΈ [1, 2.+0im] |
syntax: invalid syntax "2.+"; add space(s) to clarify |
||
π€¦ββοΈ [1, 2. +0im] |
syntax: missing separator in array expression |
||
π€¦ββοΈ [1] * (0:0.1:1).step |
too strict MethodError: no method matching *(::Vector{Int64}, ::Base.TwicePrecision{Float64}) |
Uh, note the difference: 1 ./ x
vs 1. / x
.
1+[1, 2]
:MethodError: no method matching +(::Int64, ::Vector{Int64})
1.+[1, 2]
:syntax: invalid syntax "1.+"; add space(s) to clarify
1 .+[1, 2]
: works π€¦ββοΈ1. .+[1, 2]
: convert to double