Programming

Python to Julia Converter (codeconvert.ai)

steloflute 2024. 1. 30. 22:47

Python to Julia Converter (codeconvert.ai)

 

CodeConvert AI - Convert code with a click of a button

How to use this tool? This free online converter lets you convert code from Python to Julia in a click of a button. To use this converter, take the following steps - Type or paste your Python code in the input box.Click the convert button.The resulting Jul

www.codeconvert.ai

 

생각보다 잘 된다.

 

예제:

def problem1():
    print sum(x for x in xrange(1, 1000) if x % 3 == 0 or x % 5 == 0)

 

def problem1a():

    print sum(filter(lambda x:x%3==0 or x%5==0, xrange(1,1000)))

 

problem1()


# ->

function problem1()
    println(sum(x for x in 1:999 if x % 3 == 0 || x % 5 == 0))
end

function problem1a()
    println(sum(filter(x -> x % 3 == 0 || x % 5 == 0, 1:999)))
end

problem1()

'Programming' 카테고리의 다른 글

Rust 언어의 단점  (0) 2024.06.13
CodeConvert 소개  (0) 2024.04.20
(Julia) Zero-based indexing ... (not) again  (0) 2024.01.29
(Julia) 매크로  (0) 2024.01.26
(Racket) Collatz  (0) 2024.01.09