{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "intro",
   "metadata": {},
   "source": [
    "# Practice Questions\n",
    "\n",
    "This notebook contains **10 short and simple Python practice problems**.\n",
    "\n",
    "Each question includes:\n",
    "- Function definition with correct return statements\n",
    "- Clear explanation of what the function should return"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "student_info",
   "metadata": {},
   "outputs": [],
   "source": [
    "name = 'student name'\n",
    "roll_number = 'student roll number'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0c30c434-3d9f-4615-b2a3-8c21ac5d223d",
   "metadata": {},
   "source": [
    "### 1. Check if a number is positive, negative, or zero  \n",
    "**Return:** A string like `'5 is Positive'`, `'-2 is Negative'`, or `'0 is Zero'`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "3d828395-7dda-45bf-9f89-8684ba3ae587",
   "metadata": {},
   "outputs": [],
   "source": [
    "def check_number(n: int) -> str:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c04547c-5fff-4ae4-88e8-cf76c9f85123",
   "metadata": {},
   "source": [
    "### 2. Return the sum of all numbers from 1 to n  \n",
    "**Example:** Input `5` → `15`  \n",
    "**Return:** Integer sum of all numbers from 1 to n."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6e09fc47-d535-4f66-a403-0c08104680ce",
   "metadata": {},
   "outputs": [],
   "source": [
    "def sum_1_to_n(n: int) -> int:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "0a551608-47b8-491e-9f00-0069b211e4e2",
   "metadata": {},
   "source": [
    "### 3. Count how many times a letter appears in a word  \n",
    "**Example:** Input `('banana', 'a')` → `3`  \n",
    "**Return:** The count of that letter in the word."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "f7d479a4-7d3b-4e5f-b73c-67633292a7cd",
   "metadata": {},
   "outputs": [],
   "source": [
    "def count_letter(word: str, letter: str) -> int:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "725c4152-740f-469a-b134-aa849a9d43d0",
   "metadata": {},
   "source": [
    "### 4. Return a list of even numbers between 1 and 10  \n",
    "**Return:** `[2, 4, 6, 8, 10]`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "9de89fdd-0b62-4b14-80d8-d06310e61859",
   "metadata": {},
   "outputs": [],
   "source": [
    "def even_numbers_1_to_10() -> list[int]:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "221ba30e-7f4b-4f69-8b85-f3e14ff06df9",
   "metadata": {},
   "source": [
    "### 5. Return the average of three numbers  \n",
    "**Example:** Input `(4, 8, 10)` → `7.3333...`  \n",
    "**Return:** Arithmetic mean of the three numbers."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "63d90583-126b-4324-8ea0-a6ef28ebd693",
   "metadata": {},
   "outputs": [],
   "source": [
    "def average_of_three(a: float, b: float, c: float) -> float:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "dfe5287e-ee81-45bb-aeb4-4f3e932828cd",
   "metadata": {},
   "source": [
    "### 6. Load the dataset and display the first 5 rows  \n",
    "**Hint:** Use `pd.read_csv(dataset_path)`  \n",
    "**Return:** The first 5 rows as a DataFrame."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c8f1d333-c42a-4dce-b5fd-082aa6d09a69",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "def load_head(dataset_path: str) -> pd.DataFrame:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "aa1f61df-3691-4034-b90d-b06c799d99a7",
   "metadata": {},
   "source": [
    "### 7. Display the number of rows and columns in the dataset  \n",
    "**Return:** A tuple like `(rows, columns)`"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "id": "2a37e811-0ca2-40d2-98a5-979a08dd9184",
   "metadata": {},
   "outputs": [],
   "source": [
    "def dataset_shape(dataset_path: str) -> tuple:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3c7cd80d",
   "metadata": {},
   "source": [
    "### 8. Return all column names from the dataset  \n",
    "**Return:** A list of column names.\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "6b267a67",
   "metadata": {},
   "outputs": [],
   "source": [
    "def column_names(dataset_path: str) -> list:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "366f4806",
   "metadata": {},
   "source": [
    "### 9. Return the average of a numeric column  \n",
    "**Example:** If column name is `'Sales'`, return the mean of that column.  \n",
    "**Hint:** Use `df[column_name].mean()`\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "0f9c07b6",
   "metadata": {},
   "outputs": [],
   "source": [
    "import pandas as pd\n",
    "\n",
    "def average_of_column(dataset_path: str, column_name: str) -> float:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f87d0ef1-f740-46c9-a6a1-2fe14c3d527b",
   "metadata": {},
   "source": [
    "### 10. Return all rows where a given column has a specific value  \n",
    "**Example:** `filter_by_value(dataset_path, 'Region', 'East')`  \n",
    "**Return:** Filtered DataFrame\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "id": "9da081e7-91b3-4fc2-8b09-e7c7f9b9fde0",
   "metadata": {},
   "outputs": [],
   "source": [
    "def filter_by_value(dataset_path: str, column_name: str, value) -> pd.DataFrame:\n",
    "    pass"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": ".venv (3.13.7)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.13.7"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
