Python
v3.12.0
Python
v3.12.0
Python is a high-level, dynamically typed programming language created by Guido van Rossum and first released in 1991. It emphasizes code readability through significant indentation and a clean, expressive syntax. Python is multi-paradigm, supporting procedural, object-oriented, and functional styles, and ships with a large standard library that makes it productive for everything from quick scripts to large applications.
Today Python is one of the most widely used languages in the world, dominant in data science, machine learning, automation, web backends, and education. Its rich ecosystem includes frameworks like Django and Flask for web, and NumPy, pandas, and PyTorch for numerical and AI workloads. The reference implementation, CPython, is what most developers run, and it powers a huge community of third-party packages on PyPI.
print("Hello, World!")name = input("Enter your name: ")
print(f"Hello, {name}!")fruits = ["apple", "banana", "cherry"]
for i, fruit in enumerate(fruits, start=1):
print(i, fruit)def factorial(n):
if n <= 1:
return 1
return n * factorial(n - 1)
print(factorial(5))try:
n = int("abc")
except ValueError as e:
print("Could not parse:", e)
finally:
print("Done")text = "banana"
counts = {}
for ch in text:
counts[ch] = counts.get(ch, 0) + 1
print(counts)s = " Hello, World "
print(s.strip().lower())
print(s.strip().split(", "))
print("-".join(["a", "b", "c"]))class Person:
def __init__(self, name, age):
self.name = name
self.age = age
people = [Person("Ada", 36), Person("Bob", 28)]
people.sort(key=lambda p: p.age)
for p in people:
print(p.name, p.age)nums = range(1, 11)
squares = [n * n for n in nums if n % 2 == 0]
print(squares)
print(sum(squares))def kind(x):
match x:
case 0:
return "zero"
case int():
return "int"
case _:
return "other"
print(kind(0), kind(5), kind("hi"))Yes. You can write and execute Python directly in your browser on CompileBytes without installing anything locally; just paste your code and run it.
This compiler runs CPython 3.12.0, so you can use modern features like f-strings, the match statement, and the latest standard library.
Use input() in your code, then type the values into the input/stdin box before running. Each call to input() reads one line.
Yes, running Python on CompileBytes is completely free with no sign-up required.
The standard library is always available. Availability of third-party PyPI packages depends on what is preinstalled in the runtime environment.