Lesson 1: Introduction to Python Programming
Welcome, dear reader, to the wondrous world of Python. Named not after the serpent but the comedy troupe, Python is a versatile and elegant language that lends itself to both computational tasks and scientific endeavors.
Why Python?
- Easy to learn
- Widely used in academia and industry
- Rich ecosystem of libraries
Google Colab: Your Python Playground
We shall embark on this journey using Google Colab, a free platform that provides a Python environment. Here, you can write and run Python code without any setup on your own machine.
Objective of this Lesson
The aim of this inaugural lesson is to familiarize you with Python’s basic syntax and commands. By the end, you should be able to write simple Python programs.
Basic Python Syntax
print("Hello, world!")
Practice Exercises
- Write a program that prints your name.
Solution
print("Your Name")
- Write a program that adds two numbers.
Solution
print(5 + 7)
- Write a program that calculates the area of a circle.
Solution
import math radius = 5 area = math.pi * radius ** 2 print(area)
Upcoming Lessons
- Lesson 2: Variables and Data Types
- Lesson 3: Conditional Statements
- Lesson 4: Loops
- Lesson 5: Functions