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()