Code Examples

Code examples for AI programming languages

Mr. Fuji

4/11/20231 min read

Python:

def hello_world():

print("Hello, World!")

hello_world()

R

hello_world <- function() {

cat("Hello, World!\n")

}

hello_world()

Java

public class HelloWorld {

public static void main(String[] args) {

System.out.println("Hello, World!");

}

}

Lisp

(defun hello-world ()

(format t "Hello, World!~%"))

Prolog

(hello-world)

hello_world :- write('Hello, World!'), nl.

?- hello_world.

C++

#include <iostream>

int main() {

std::cout << "Hello, World!" << std::endl;

return 0;

}

Julia

function hello_world()

println("Hello, World!")

end

hello_world()