☕ Java
🐍 Python
Ready
▶ Run
public class Main { public static void main(String[] args) { System.out.println("Hello from Java!"); int n = 5; System.out.println("Factorial of " + n + " is: " + factorial(n)); } public static int factorial(int n) { if (n <= 1) return 1; return n * factorial(n - 1); } }
# Write your Python code here def factorial(n): return 1 if n <= 1 else n * factorial(n - 1) print("Hello from Python!") n = 5 print(f"Factorial of {n} is: {factorial(n)}")
Console Output
Press "Run" to compile and execute your code.