



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!




Variables store data that can be used and manipulated in your program. Data types define the kind of data stored (e.g., integers, strings, lists). Example:
name = "Alice" # String age = 25 # Integer height = 5.6 # Float is_student = True # Boolean Control structures allow you to dictate the flow of your program based on conditions. Example (If-Else):
if age > 18: print("Adult") else: print("Not an Adult") Example (Loops):
for i in range(5): print(i) Functions are blocks of code that perform a specific task and can be reused in your program. Example:
def greet(name): return "Hello, " + name print(greet("Alice")) #### ``` ## 4. Coding in Python ### Introduction to Python Python is a versatile language that's beginner-friendly and widely used in various domains like web development, data science, and automation. ### Writing Your First Python Program Let's start with a simple 'Hello, World!' program: **Example:** ```python print("Hello, World!")