Tutorial: Introduction to Python
Get started with Python, a versatile and beginner-friendly programming language.
By Upingi Team / Tutorial Level: Beginner
Get started with Python, a versatile and beginner-friendly programming language.
By Upingi Team / Tutorial Level: Beginner
Python is known for its readability and simple syntax, making it an excellent first language. It's widely used in web development, data science, automation, machine learning, and more.
Learning Python opens doors to numerous career paths and allows you to build a wide variety of applications.
Let's write some Python code!
Let's start with the traditional "Hello, World!" example.
You've executed your first Python code!
Lists are ordered, mutable sequences used to store collections of items. You can iterate over lists using loops.
Creating Lists: Use square brackets `[]`.
# Empty list
my_list = []
# List of numbers
numbers = [1, 5, 2, 8]
# List of strings
names = ["Alice", "Bob", "Charlie"]
# Mixed list
mixed = [10, "Hello", 3.14]
Accessing Elements: Use zero-based indexing.
print(names[0]) # Output: Alice
print(numbers[1]) # Output: 5
Looping with `for`: Iterate through each item in a list.
for name in names:
print(f"Hello, {name}!")
# Output:
# Hello, Alice!
# Hello, Bob!
# Hello, Charlie!
Dictionaries (Brief Intro): Dictionaries store key-value pairs, enclosed in curly braces `{}`.
person = {"name": "Alice", "age": 30}
print(person["name"]) # Output: Alice
Congratulations on starting your Python journey! You've learned how to run scripts, use variables, and understand basic data types.
Keep exploring: