{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "3410e01a",
   "metadata": {},
   "source": [
    "# Control Flow Practice Questions (Instructor Solutions)\n",
    "\n",
    "This notebook contains 10 short control-flow practice problems with clear, testable solutions."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b2f3fc82",
   "metadata": {},
   "outputs": [],
   "source": [
    "name = 'student name'\n",
    "roll_number = 'student roll number'"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "5f8c14f2",
   "metadata": {},
   "source": [
    "### 1. Write a program to check if a number is **positive, negative, or zero**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b7c16284",
   "metadata": {},
   "outputs": [],
   "source": [
    "def check_number(n: int) -> str:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "269b03e5",
   "metadata": {},
   "source": [
    "### 2. Write a program that prints all numbers from **1 to 10** using a `for` loop."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "a856a39d",
   "metadata": {},
   "outputs": [],
   "source": [
    "def numbers_1_to_10() -> list[int]:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "cff29bcc",
   "metadata": {},
   "source": [
    "### 3. Write a program that prints only **even numbers** from 1 to 20."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "48672919",
   "metadata": {},
   "outputs": [],
   "source": [
    "def even_1_to_20() -> list[int]:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "6bd1ddc6",
   "metadata": {},
   "source": [
    "### 4. Write a program that checks if a given year is a **leap year**."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "b3ab6d3b",
   "metadata": {},
   "outputs": [],
   "source": [
    "def is_leap_year(year: int) -> bool:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "964b3649",
   "metadata": {},
   "source": [
    "### 5. Write a program that keeps asking for a password until the user enters \"python\"."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "049cae9c",
   "metadata": {},
   "outputs": [],
   "source": [
    "def ask_password(simulated_inputs: list[str] | None=None) -> str:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "57197c2b",
   "metadata": {},
   "source": [
    "### 6. Write a program that counts the number of vowels in a given word."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "c88b8f75",
   "metadata": {},
   "outputs": [],
   "source": [
    "def count_vowels(word: str) -> int:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "f59e9410",
   "metadata": {},
   "source": [
    "### 7. Write a program that prints the multiplication table for a given number."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "d08a8ddf",
   "metadata": {},
   "outputs": [],
   "source": [
    "def multiplication_table(n: int, upto: int = 10) -> list[str]:\n",
    "    \"\"\"Return multiplication table lines for n from 1..upto as strings.\"\"\"\n",
    "    lines = []\n",
    "    for i in range(1, upto + 1):\n",
    "        lines.append(f'{} x {} = {}'.format(n, i, n * i))\n",
    "    return lines\n",
    "\n",
    "# multiplication_table(3, 5)"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "ed5e2ee9",
   "metadata": {},
   "source": [
    "### 8. Write a program to **sum all numbers** from 1 to 100 using a loop."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4bf8d1f5",
   "metadata": {},
   "outputs": [],
   "source": [
    "def sum_1_to_100_loop() -> int:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "bc9079c8",
   "metadata": {},
   "source": [
    "### 9. Write a program to find the **largest number** from a list of 5 numbers entered by the user."
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "59e8076f",
   "metadata": {},
   "outputs": [],
   "source": [
    "def largest_of_five(nums: list[float]) -> float:\n",
    "    pass"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "d21467a9",
   "metadata": {},
   "source": [
    "### 10. Bonus Fun One 🎭: Ask the user’s mood — if \"happy\", print \"Keep smiling!\"; if \"sad\", print \"Cheer up, Python believes in you!\"; else, print \"Processing emotions... try again.\""
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "0d982d56",
   "metadata": {},
   "outputs": [],
   "source": [
    "def mood_response(mood: str) -> str:\n",
    "    pass"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
