Program 1: Simple Addition of Two Numbers Program: def add(a, b): """Add two numbers using positional arguments.""" return a + b # Test the function print("Sum of 5 and 7:", add(5, 7)) Expected Output: Sum of 5 and 7: 12 Program 2: Calculate the Difference Between Two Numbers Program: def subtract(a, b): """Subtract the second number from the first using positional arguments.""" return a – b # Test the function print("Difference between 10 and 3:", subtract(10, 3)) Expected Output: Difference between 10 and 3: 7 Program 3: Multiply Two Numbers Program: def multiply(a, b): """Multiply two numbers using positional arguments.""" return a * b # Test the function print("Product of 4 and 6:", multiply(4, 6)) Expected Output: Product of 4 and 6: 24 Program 4: Divide Two Numbers Program: def divide(a, b): """Divide the first number by the second using positional arguments.""" if b != 0: return a / b else: return "Error: Division by zero" # Test the function print("Division of 20 by 4:", divide(20, 4)) Expected Output: Division of 20 by 4: 5.0 Program 5: Calculate Power of a Number Program: def power(base, exponent): """Calculate the power of a number using positional arguments.""" return base ** exponent # Test the function print("2 raised to the power of 3:", power(2, 3)) Expected Output: 2 raised to the power of 3: 8 Program 6: Swap Two Numbers Program: def swap(a, b): """Swap two numbers using positional arguments.""" return b, a # Test the function x, y = swap(10, 20) print("After swapping: x =", x, ", y =", y) Expected Output: After swapping: x = 20 , y = 10 Program 7: Calculate Average of Two Numbers Program: def average(a, b): """Calculate the average of two numbers using positional arguments.""" return (a + b) / 2 # Test the function print("Average of 5 and 9:", average(5, 9)) Expected Output: Average of 5 and 9: 7.0 Program 8: Check if Two Numbers Are Equal Program: def are_equal(a, b): """Check if two numbers are equal using positional arguments.""" return a == b # Test the function print("Are 10 and 10 equal?", are_equal(10, 10)) Expected Output: Are 10 and 10 equal? True Program 9: Find Maximum of Two Numbers Program: def maximum(a, b): """Return the maximum of two numbers using positional arguments.""" return max(a, b) # Test the function print("Maximum of 15 and 20:", maximum(15, 20)) Expected Output: Maximum of 15 and 20: 20 Program 10: Find Minimum of Two Numbers Program: def minimum(a, b): """Return the minimum of two numbers using positional arguments.""" return min(a, b) # Test the function print("Minimum of 30 and 25:", minimum(30, 25)) Expected Output: Minimum of 30 and 25: 25 Default Arguments (10 Programs) Program 1: Greet with Default Name Program: def greet(name="User"): """Greet a person, with a default name if none is provided.""" return f"Hello, {name}!" # Test the function print(greet()) # Using default argument print(greet("Alice")) # Using custom argument Expected Output: Hello, User! Hello, Alice! Program 2: Calculate the Price After Discount (with Default Discount) Program: def calculate_price(original_price, discount=10): """Calculate price after applying a discount. Default discount is 10%.""" discounted_price = original_price * (1 – discount / 100) return discounted_price # Test the function print("Price after discount (default 10%):", calculate_price(100)) print("Price after discount (20%):", calculate_price(100, 20)) Expected Output: Price after discount (default 10%): 90.0 Price after discount (20%): 80.0 Program 3: Get Discounted Price with Default Tax Program: def calculate_total_price(price, discount=5, tax=8): """Calculate total price after discount and tax (default tax is 8%).""" discounted_price = price – (price * discount / 100) total_price = discounted_price + (discounted_price * tax / 100) return total_price # Test the function print("Total price with default discount and tax:", calculate_total_price(200)) print("Total price with custom discount and tax:", calculate_total_price(200, 10, 12)) Expected Output: Total price with default discount and tax: 199.04 Total price with custom discount and tax: 198.0 Program 4: Calculate Rectangle Area with Default Width Program: def calculate_area(length, width=5): """Calculate area of a rectangle, with default width 5.""" return length * width # Test the function print("Area with default width:", calculate_area(10)) print("Area with custom width:", calculate_area(10, 8)) Expected Output: Area with default width: 50 Area with custom width: 80 Program 5: Display Full Name (with Default Middle Name) Program: def display_name(first_name, last_name, middle_name=""): """Display full name, with an optional middle name.""" if middle_name: return f"{first_name} {middle_name} {last_name}" else: return f"{first_name} {last_name}" # Test the function print(display_name("John", "Doe")) # Without middle name print(display_name("John", "Doe", "Michael")) # With middle name Expected Output: John Doe John Michael Doe Program 6: Find the Total Price (with Default Tax) Program: def find_total_price(price, tax_rate=5): """Find total price including tax. Default tax rate is 5%.""" total_price = price + (price * tax_rate / 100) return total_price # Test the function print("Total price (default 5% tax):", find_total_price(200)) print("Total price (10% tax):", find_total_price(200, 10)) Expected Output: Total price (default 5% tax): 210.0 Total price (10% tax): 220.0 Program 7: Calculate Circle Circumference (with Default Pi) Program: def calculate_circumference(radius, pi=3.14159): """Calculate the circumference of a circle, with default value of pi.""" return 2 * pi * radius # Test the function print("Circumference (default pi):", calculate_circumference(7)) print("Circumference (custom pi):", calculate_circumference(7, 3.14)) Expected Output: Circumference (default pi): 43.98226 Circumference (custom pi): 43.96 Program 8: Calculate Compound Interest (with Default Rate) Program: def compound_interest(principal, rate=5, time=1): """Calculate compound interest with default rate 5% and time 1 year.""" amount = principal * (1 + rate / 100) ** time return amount – principal # Test the function print("Compound interest (default rate and time):", compound_interest(1000)) print("Compound interest (custom rate and time):", compound_interest(1000, 7, 2)) Expected Output: Compound interest (default rate and time): 50.0 Compound interest (custom rate and time): 140.0 Program 9: Get Greeting Message (with Default Language) Program: def greet(language="English"): """Return a greeting message in the specified language.""" greetings = { "English": "Hello!", "Spanish": "¡Hola!", "French": "Bonjour!", "German": "Hallo!" } return greetings.get(language, "Hello!") # Test the function print(greet()) # Default English print(greet("Spanish")) # Custom Spanish Expected Output: Hello! ¡Hola! Program 10: Calculate Perimeter of a Square (with Default Side Length) Program: def calculate_perimeter(side_length=4):