Python # Comments start with a hash symbol

# VARIABLES x = 5 # Integer y = 3.14 # Floating-point number z = "Hello, world!" # String is_true = True # Boolean

# PRINTING print("Hello, world!") # Print a string print(x) # Print a variable print(f"The value of x is {x}") # Print a formatted string

# INPUT name = input("What is your name? ") # Get input from the user

# CONDITIONALS if x > y: print("x is greater than y") elif x 0: # Loop until x is 0 print(x) x -= 1

# LISTS my_list = [1, 2, 3] # Create a list my_list.append(4) # Add an element to the end of the list print(my_list) # Access an element by index for item in my_list: # Loop over the list print(item)

# OBJECTS class Person: def __init__(self, name, age): self.name = name self.age = age

def say_hello(self): print(f"Hello, my name is {self.name} and I am {self.age} years old.")

p = Person("John", 30) p.say_hello() # Call a method on the object print(p.name) # Access an attribute of the object JavaScipt // Comments start with double slashes

// VARIABLES let x = 5; // Integer let y = 3.14; // Floating-point number let z = "Hello, world!"; // String let isTrue = true; // Boolean

// PRINTING console.log("Hello, world!"); // Print a string console.log(x); // Print a variable console.log(`The value of x is ${x}`); // Print a formatted string

// INPUT let name = prompt("What is your name?"); // Get input from the user

// CONDITIONALS if (x > y) { console.log("x is greater than y"); } else if (x 0) { // Loop until x is 0 console.log(x); x--; }

// ARRAYS let myArray = [1, 2, 3]; // Create an array myArray.push(4); // Add an element to the end of the array console.log(myArray); // Access an element by index for (let item of myArray) { console.log(item); // Loop over the array }

// FUNCTIONS function sayHello(name) { console.log(`Hello, ${name}!`); } sayHello("John"); // Call the function

// OBJECTS let myObject = { name: "John", age: 30, hobbies: ["reading", "playing guitar"] }; console.log(myObject.name); // Access a property by name

// DOM MANIPULATION let myElement = document.getElementById("my-element"); // Get an element by ID myElement.innerHTML = "Hello, world!"; // Change the element's content myElement.style.color = "red"; // Change the element's style

Eisp ;; Comments start with double semicolons

;; VARIABLES (setq x 5) ; Integer (setq y 3.14) ; Floating-point number (setq z "Hello, world!") ; String (setq is_true t) ; Boolean

;; PRINTING (message "Hello, world!") ; Print a string (message "%d" x) ; Print a variable

;; INPUT (setq name (read-string "What is your name? ")) ; Get input from the user

;; CONDITIONALS (if (> x y) (message "x is greater than y") (if ( x 0) ; Loop until x is 0 (message "%d" x) (setq x (- x 1)))

;; LISTS (setq my-list '(1 2 3)) ; Create a list (add-to-list 'my-list 4) ; Add an element to the end of the list (nth 0 my-list) ; Access an element by index (dolist (item my-list) ; Loop over the list (message "%d" item))

;; OBJECTS (defclass person () ((name :initarg :name :type string) (age :initarg :age :type integer)))

(defun say-hello (person) (message (concat "Hello, my name is " (oref person name) " and I am " (number-to-string (oref person age)) " years old.")))

(setq p (make-instance 'person :