Python is a high-level, interpreted programming language known for its simplicity and readability. It was created by Guido van Rossum and first released in 1991. Python's design philosophy emphasizes code readability, making it an excellent choice for beginners.
Let's start with the classic "Hello, World!" program:
print("Hello, World!")
This simple line of code will output: Hello, World!
The print() function is used to display output on the screen. You can print:
print("Hello")print(42)print("Hello", "World")# Print a simple message
print("Welcome to Python!")
# Print a number
print(100)
# Print multiple items
print("I am", 25, "years old")
Comments are lines of code that Python ignores. They help explain what your code does. Comments start with a # symbol:
# This is a comment
print("This will be executed") # This is also a comment
# You can use comments to explain your code
# This makes it easier for others to understand
print() to display output# and are ignored by PythonTry writing your own Python program that prints your name and age. Use the interactive code editor to test your code!
Open Code Editor