summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--mysql-php/code/a1.php139
-rw-r--r--mysql-php/code/a2.php78
-rw-r--r--mysql-php/code/a3.php95
-rw-r--r--mysql-php/index.typ63
-rw-r--r--mysql-php/output/1/1.pngbin0 -> 38936 bytes
-rw-r--r--mysql-php/output/1/2.pngbin0 -> 97622 bytes
-rw-r--r--mysql-php/output/2.pngbin0 -> 75186 bytes
-rwxr-xr-xmysql-php/sbld2
-rw-r--r--mysql-php/text/a1.typ15
-rw-r--r--mysql-php/text/a2.typ12
-rw-r--r--mysql-php/tpl.typ53
-rw-r--r--mysql-php/vendor/gr.tmTheme566
-rw-r--r--opencv/index.typ51
-rw-r--r--opencv/tpl.typ47
-rwxr-xr-xpython/abld4
-rw-r--r--python/code/1/1.txt17
-rw-r--r--python/code/1/2.txt52
-rw-r--r--python/code/1/3.txt17
-rw-r--r--python/code/1/4.py8
-rw-r--r--python/code/1/6.py4
-rw-r--r--python/code/1/7.py5
-rw-r--r--python/code/2/1.py27
-rw-r--r--python/code/2/2.py12
-rw-r--r--python/code/2/3.py6
-rw-r--r--python/code/2/4.py27
-rw-r--r--python/code/2/5.py35
-rw-r--r--python/code/2/6.py11
-rw-r--r--python/code/2/7.py9
-rw-r--r--python/code/3/3.py11
-rw-r--r--python/code/3/4.py25
-rw-r--r--python/code/3/5.py5
-rw-r--r--python/code/3/6.py27
-rw-r--r--python/code/3/7.py9
-rw-r--r--python/index.typ224
-rw-r--r--python/output/1/6.txt7
-rw-r--r--python/output/2/1.txt12
-rw-r--r--python/output/2/2.txt4
-rw-r--r--python/output/2/4.txt24
-rw-r--r--python/output/2/5.txt34
-rw-r--r--python/output/2/6.txt7
-rw-r--r--python/output/2/7.txt24
-rw-r--r--python/output/3/3.txt9
-rw-r--r--python/output/3/5.txt4
-rw-r--r--python/output/3/6.txt12
-rw-r--r--python/output/3/7.txt9
-rwxr-xr-xpython/sbld2
-rw-r--r--python/tpl.typ51
-rw-r--r--python/vendor/gr.tmTheme566
48 files changed, 2421 insertions, 0 deletions
diff --git a/mysql-php/code/a1.php b/mysql-php/code/a1.php
new file mode 100644
index 0000000..022b9ee
--- /dev/null
+++ b/mysql-php/code/a1.php
@@ -0,0 +1,139 @@
+<?php
+declare(strict_types=1);
+error_reporting(E_ALL);
+// student: name roll city email date_of_birth
+function connect_to_database() {
+    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
+    if (!($dbh = mysqli_connect('localhost', 'root', '')))
+        display_failure('Could not connect to the database: ' . mysqli_connect_error($dbh));
+    mysqli_set_charset($dbh, 'utf8mb4');
+    if (!mysqli_query($dbh, 'CREATE DATABASE IF NOT EXISTS STUDENTS_DB'))
+        display_failure('Could not create database: ' . mysqli_error($dbh));
+    mysqli_select_db($dbh, 'STUDENTS_DB');
+    if (!mysqli_query($dbh, 'CREATE TABLE IF NOT EXISTS STUDENT (
+        ROLL INT(20) PRIMARY KEY,
+        NAME VARCHAR(255),
+        CITY VARCHAR(255),
+        EMAIL VARCHAR(255),
+        DATE_OF_BIRTH DATE
+    )'))
+        display_failure('Could not create table: ' . mysqli_error($dbh));
+    return $dbh;
+}
+
+function html_prologue($title) {
+?><!doctype html>
+<meta charset="utf-8">
+<title><?php echo $title; ?></title>
+<style>
+body { font-family: sans-serif; font-size: 1.3rem; }
+h1 { font-size: 2rem; font-weight: 500; }
+form { margin: 2em auto; width: 20em; }
+form input { float: right; }
+form input[type=submit] { float: none; display: block; margin: 0 auto;  }
+form > * { display: block; padding: 0.5em; }
+table, tr, th, td { border-collapse: collapse; border: 1px solid black; }
+th, td { padding: 5px; }
+</style>
+<?php
+}
+
+function display_form() {
+    html_prologue('Student details');
+    ?>
+<form method="post" action="<?php echo $_SERVER['PHP_SELF']; ?>">
+    <h1>Enter student's details</h1>
+    <label>Name: <input type="text" name="name"></label>
+    <label>Roll No.: <input type="number" name="roll"></label>
+    <label>City: <input type="text" name="city"></label>
+    <label>Email: <input type="email" name="email"></label>
+    <label>Date of birth: <input type="date" name="date_of_birth"></label>
+    <input type="submit" value="Submit">
+    <a href="<?php echo $_SERVER['PHP_SELF']; ?>?details">Show students' details</a>
+</form>
+<?php
+}
+
+function display_success() {
+    html_prologue('Operation successful');
+    ?>
+<h2>Insertion successful.</h2>
+<?php
+}
+
+function display_failure($reason) {
+    html_prologue('Operation failure');
+    ?>
+<h2>Operation failed</h2>
+<p>Reason: <?php echo $reason; ?></p>
+<?php
+    die();
+}
+
+function check_post_vars($vardesc) {
+    $vars = [];
+    foreach ($vardesc as $name => $desc) {
+        if (!isset($_POST[$name]) || empty($_POST[$name]))
+            display_failure('The ' . $desc . ' field can not be empty');
+        $vars[$name] = $_POST[$name];
+    }
+    return $vars;
+}
+
+function insert_details($dbh) {
+    $vars = check_post_vars([
+        'name' => 'Name',
+        'email' => 'E-mail address',
+        'date_of_birth' => 'Date of birth',
+        'city' => 'City',
+        'roll' => 'Roll No.'
+    ]);
+    $stmt = mysqli_prepare($dbh, 'INSERT INTO STUDENT (
+        ROLL, NAME, EMAIL, CITY, DATE_OF_BIRTH
+    ) VALUES (?,?,?,?,?)');
+    mysqli_stmt_execute($stmt, [
+        $vars['roll'], $vars['name'], $vars['email'], $vars['city'], 
+        $vars['date_of_birth']
+    ]);
+}
+
+function show_table($dbh) {
+    $result = mysqli_query($dbh, 'SELECT * FROM STUDENT');
+    html_prologue('Students\' details');
+    ?>
+<h2>Students' details</h2>
+<p><?php echo mysqli_num_rows($result); ?> record(s) found.</p>
+<table>
+    <tr>
+        <th>Roll No.</th>
+        <th>Name</th>
+        <th>E-mail</th>
+        <th>City</th>
+        <th>Date of birth</th>
+    </tr><?php
+    while ($row = mysqli_fetch_assoc($result)) { ?>
+    <tr><td>
+        <?php echo implode('</td><td>', array_map('htmlspecialchars', [
+            $row['ROLL'], $row['NAME'], $row['EMAIL'], $row['CITY'],
+            $row['DATE_OF_BIRTH']		
+        ])); ?>
+    </td></tr>
+    <?php
+    } ?>
+</table>
+<?php
+}
+
+if ($_SERVER['REQUEST_METHOD'] === 'POST') {
+    $dbh = connect_to_database();
+    insert_details($dbh);
+    display_success();
+    mysqli_close($dbh);
+} elseif (isset($_SERVER['QUERY_STRING']) 
+        && $_SERVER['QUERY_STRING'] === 'details') {
+    $dbh = connect_to_database();
+    show_table($dbh);
+    mysqli_close($dbh);
+} else {
+    display_form();
+}
diff --git a/mysql-php/code/a2.php b/mysql-php/code/a2.php
new file mode 100644
index 0000000..c03789f
--- /dev/null
+++ b/mysql-php/code/a2.php
@@ -0,0 +1,78 @@
+<?php
+declare(strict_types=1);
+error_reporting(E_ALL);
+// student: name roll city email date_of_birth
+function connect_to_database() {
+    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
+    if (!($dbh = mysqli_connect('localhost', 'root', '')))
+        display_failure('Could not connect to the database: ' . mysqli_connect_error($dbh));
+    mysqli_set_charset($dbh, 'utf8mb4');
+    if (!mysqli_query($dbh, 'CREATE DATABASE IF NOT EXISTS STUDENTS_DB'))
+        display_failure('Could not create database: ' . mysqli_error($dbh));
+    mysqli_select_db($dbh, 'STUDENTS_DB');
+    if (!mysqli_query($dbh, 'CREATE TABLE IF NOT EXISTS STUDENT (
+        ROLL INT(20) PRIMARY KEY,
+        NAME VARCHAR(255),
+        CITY VARCHAR(255),
+        EMAIL VARCHAR(255),
+        DATE_OF_BIRTH DATE
+    )'))
+        display_failure('Could not create table: ' . mysqli_error($dbh));
+    return $dbh;
+}
+
+function display_failure($reason) {
+    html_prologue('Operation failure');
+    ?>
+<h2>Operation failed</h2>
+<p>Reason: <?php echo $reason; ?></p>
+<?php
+    die();
+}
+
+function html_prologue($title) {
+?><!doctype html>
+<meta charset="utf-8">
+<title><?php echo $title; ?></title>
+<style>
+body { font-family: sans-serif; font-size: 1.3rem; }
+h1 { font-size: 2rem; font-weight: 500; }
+table, tr, th, td { border-collapse: collapse; border: 1px solid black; }
+th, td { padding: 5px; }
+</style>
+<?php
+}
+
+function show_table($dbh) {
+    if (!($result = mysqli_query($dbh, 'SELECT * FROM STUDENT 
+            WHERE YEAR(DATE_OF_BIRTH) BETWEEN 2000 AND 2005')))
+        display_failure('Could not perform query: ' . mysqli_error($dbh));
+    html_prologue('Students\' details');
+    ?>
+<h2>Students' details</h2>
+<p>The students who were born in years 2000 to 2005, inclusive.</p>
+<p><?php echo mysqli_num_rows($result); ?> record(s) found.</p>
+<table>
+    <tr>
+        <th>Roll No.</th>
+        <th>Name</th>
+        <th>E-mail</th>
+        <th>City</th>
+        <th>Date of birth</th>
+    </tr><?php
+    while ($row = mysqli_fetch_assoc($result)) { ?>
+    <tr><td>
+        <?php echo implode('</td><td>', array_map('htmlspecialchars', [
+            $row['ROLL'], $row['NAME'], $row['EMAIL'], $row['CITY'],
+            $row['DATE_OF_BIRTH']		
+        ])); ?>
+    </td></tr>
+    <?php
+    } ?>
+</table>
+<?php
+}
+
+$dbh = connect_to_database();
+show_table($dbh);
+mysqli_close($dbh);
diff --git a/mysql-php/code/a3.php b/mysql-php/code/a3.php
new file mode 100644
index 0000000..f029dd8
--- /dev/null
+++ b/mysql-php/code/a3.php
@@ -0,0 +1,95 @@
+<?php
+declare(strict_types=1);
+error_reporting(E_ALL);
+// student: name roll city email date_of_birth
+function connect_to_database() {
+    mysqli_report(MYSQLI_REPORT_ERROR | MYSQLI_REPORT_STRICT);
+    if (!($dbh = mysqli_connect('localhost', 'root', '')))
+        display_failure('Could not connect to the database: ' . mysqli_connect_error($dbh));
+    mysqli_set_charset($dbh, 'utf8mb4');
+    if (!mysqli_query($dbh, 'CREATE DATABASE IF NOT EXISTS STUDENTS_DB'))
+        display_failure('Could not create database: ' . mysqli_error($dbh));
+    mysqli_select_db($dbh, 'STUDENTS_DB');
+    if (!mysqli_query($dbh, 'CREATE TABLE IF NOT EXISTS STUDENT (
+        ROLL INT(20) PRIMARY KEY,
+        NAME VARCHAR(255),
+        CITY VARCHAR(255),
+        EMAIL VARCHAR(255),
+        DATE_OF_BIRTH DATE
+    )'))
+        display_failure('Could not create table: ' . mysqli_error($dbh));
+    return $dbh;
+}
+
+function html_prologue($title) {
+?><!doctype html>
+<meta charset="utf-8">
+<title><?php echo $title; ?></title>
+<style>
+body { font-family: sans-serif; font-size: 1.3rem; }
+h1 { font-size: 2rem; font-weight: 500; }
+h2 { font-size: 1.8rem; font-weight: 500; }
+form { margin: 2em auto; width: 20em; }
+form > * { padding: 0.5em; }
+table, tr, th, td { border-collapse: collapse; border: 1px solid black; }
+th, td { padding: 5px; }
+</style>
+<?php
+}
+
+function display_search_form() {
+    html_prologue('Student details');
+    ?>
+<form action="<?php echo $_SERVER['PHP_SELF']; ?>">
+    <h2>Enter E-mail address to search for the record of a student</h2>
+    <label>E-mail: <input type="email" name="email"></label>
+    <input type="submit" value="Search">
+</form>
+<?php
+}
+
+function display_failure($reason) {
+    html_prologue('Operation failure');
+    ?>
+<h2>Operation failed</h2>
+<p>Reason: <?php echo $reason; ?></p>
+<?php
+    die();
+}
+
+function search_and_show($dbh, $email) {
+    $stmt = mysqli_prepare($dbh, 'SELECT * FROM STUDENT WHERE EMAIL = ?');
+    $result = mysqli_query($dbh, );
+    html_prologue('Students\' details');
+    ?>
+<h2>Students' details</h2>
+<p><?php echo mysqli_num_rows($result); ?> record(s) found.</p>
+<table>
+    <tr>
+        <th>Roll No.</th>
+        <th>Name</th>
+        <th>E-mail</th>
+        <th>City</th>
+        <th>Date of birth</th>
+    </tr><?php
+    while ($row = mysqli_fetch_assoc($result)) { ?>
+    <tr><td>
+        <?php echo implode('</td><td>', array_map('htmlspecialchars', [
+            $row['ROLL'], $row['NAME'], $row['EMAIL'], $row['CITY'],
+            $row['DATE_OF_BIRTH']		
+        ])); ?>
+    </td></tr>
+    <?php
+    } ?>
+</table>
+<?php
+}
+
+if (isset($_GET['email']) && !empty($_GET['email'])) {
+    $dbh = connect_to_database();
+    search_and_show($dbh, $_GET['email']);
+    mysqli_close($dbh);
+} else {
+    html_prologue('Search for a student');
+    display_search_form();
+}
diff --git a/mysql-php/index.typ b/mysql-php/index.typ
new file mode 100644
index 0000000..c231878
--- /dev/null
+++ b/mysql-php/index.typ
@@ -0,0 +1,63 @@
+#import "tpl.typ": *
+#import "@preview/tablex:0.0.6": tablex, vlinex, hlinex, colspanx
+#show: body => apply(body)
+#let semibold(body) = text(weight: 600, body)
+#text(size: 1.3em, align(center)[#semibold[Practical Assignments] \ _for_ \ #semibold[RDBMS Lab] \ _using_ \ #semibold[MySQL and PHP]])
+#set enum(full: true, numbering: (..args) => {
+  let patterns = ("1.", "(a)")
+  let pattern = patterns.at(calc.min(args.pos().len(), patterns.len()) - 1)
+  numbering(pattern, args.pos().last())
+})
+
+#set raw(lang: "php")
+
++ Create a table `Student` in a MySQL database containing the fields `name`, `roll`, `city`, `email` and `date_of_birth` and insert 5 records into this table and display them using PHP.
++ Write a PHP script to insert the records in the table in Question 2 and display the records in a separate table of all those students who were born in between `01/01/2000` to `31/12/2005`.
++ Design a HTML form to take a valid email from user and search the corresponding student from the database using PHP script and display the details of that student in tabular form.
++ Design a `Login` table to take `username` and `password`. Show all records of the `Student` table for an authorized user. A user if authorized when the username and password exists in the `Login` table of the MySQL database.
++ Design a Login form and check valid username and password to display student details using PHP script. Also write a PHP script allowing to change username and password.
++ Write PHP script to insert, delete and update records in a table.
++ Suppose a table `Food_Details` containing the fields `Food_items` and `Price_per_item`. Design a menu to select different food items and input the quantity ordered by customer. Generate a bill containing Customer name, Food items, quantity, price and Total price. Net price should be the total price plus 15% GST of total price.
++ Create a table as Question 7. Create another table `Customer_details` containing the fields `customer_name`, `total_amount_paid`, `date_of_payment`. Design a menu to select different food items and input the quantity ordered by customer. Generate a bill containing Customer name, Food items, quantity, and Total price. Also insert the record i.e. customer name, total amount paid and date of payment in `Customer_details` table. Net price should be the total price plus 15% GST of total price.
++ Suppose a table `Salary` contained the fields `EmpName`, `BasicPay`, `HRA`, `DA` and `Professional_tax`. Record should exists only for `EmpName` and `BasicPay`. Design a HTML form to take input for HRA percentage, DA percentage, and Professional tax. Now write a PHP script to generate the DA, HRA and Professional tax of every employee and store them into Salary table with respect to every employee. Now display the records.
++ Design a HTML form to take inputs from user and store the records into a table `Employee` using PHP script containing the following fields.
+  #align(center, tablex(
+    columns: 2,
+    auto-lines: false,
+    hlinex(),
+    vlinex(), vlinex(), vlinex(),
+    [*Fields*], [*Form input control*],
+    hlinex(),
+    [`Ename`], [textbox],
+    [`Address`], [textarea],
+    [`Phno`], [textbox],
+    [`Salary`], [textbox],
+    [`Category` \ (out of GEN, SC, ST, OBC)], [radio buttons],
+    [`Language`], [checkbox],
+    hlinex(),
+  ))
+  (Multiple languages have to be concatenate into a string separated by commas and then store into database like `Bengali, English, Hindi`.)
++ Write a PHP script to display the employee records of the above `Employee` table order by user’s choice field. The field have to be choices through drop down menu containing all fields of the table.
++ Create a table `Sports` in MySQL database containing the fields `Players`, `TestRuns`, `ODIRuns`, `T20IRuns`. Insert and display the record with total individual runs of every player (like `TestRun + ODIRun + T20IRun`) using PHP.
++ Display the record of highest run scorer in Test or T20I or ODI according to user’s choice through a drop down menu for the table in Question 13. Drop down menu contains the fields name `TestRuns`, `ODIRuns`, `T20IRuns`.
++ Design a HTML form to take records from user for the above table `Sports`. Now write PHP script to insert, update and delete records through PHP script.
++ Design a form to take input from user and store into a table containing the fields `name`, `city`, `phno`, `email`, `password`. Write a PHP script to take input and store into the table such that Phno and mail id of every person must be unique.
++ Create a MySQL database table `Employee` with fields `ename`, `eid`, `salary`, `dept` and `dob`. Perform all database operations like select, insert, delete and update through PHP.
++ Create a table `Marks` with the fields `stdname`, `roll`, `CompScMarks`, `PhysicsMarks`, `ChemistryMarks`. Design a form to insert records into database and display records with grade using PHP script.
+  #align(center, tablex(
+    columns: (8em, 4em),
+    auto-lines: false,
+    align: center + horizon,
+    colspanx(2)[$ m = ""$average marks of all subjects.],
+    hlinex(),
+    vlinex(start: 1), vlinex(start: 1), vlinex(start: 1),
+    [*Marks*], [*Grade*],
+    hlinex(),
+    [$80 <= m <= 100$], [A],
+    [$60 <= m < 80$], [B],
+    [$40 <= m < 60$], [C],
+    [$0 <= m < 40$], [D],
+    hlinex(),
+  ))
++ Create MySQL database table `Dept` with field `dno`, `dname` where `dno` is the primary key. Create another table `Employee` with field `eno`, `ename`, `city`, `salary`, `join_date`, `dno` where `eno` is the primary key and `dno` is a foreign key reference to the `Dept` table. Include other constraints like `NOT NULL`, `CHECK` etc. Perform all database operation like select, insert, update, and delete using PHP. (Query may include `group by`, `having`, `order by`, aggregate functions, `like` operator.)
+
diff --git a/mysql-php/output/1/1.png b/mysql-php/output/1/1.png
new file mode 100644
index 0000000..a165e62
--- /dev/null
+++ b/mysql-php/output/1/1.png
Binary files differdiff --git a/mysql-php/output/1/2.png b/mysql-php/output/1/2.png
new file mode 100644
index 0000000..8d99484
--- /dev/null
+++ b/mysql-php/output/1/2.png
Binary files differdiff --git a/mysql-php/output/2.png b/mysql-php/output/2.png
new file mode 100644
index 0000000..b324c1c
--- /dev/null
+++ b/mysql-php/output/2.png
Binary files differdiff --git a/mysql-php/sbld b/mysql-php/sbld
new file mode 100755
index 0000000..33a51ed
--- /dev/null
+++ b/mysql-php/sbld
@@ -0,0 +1,2 @@
+#!/bin/sh
+typst ${2:-c} --root $PWD text/a$1.typ docs/s$1.pdf
diff --git a/mysql-php/text/a1.typ b/mysql-php/text/a1.typ
new file mode 100644
index 0000000..efdc981
--- /dev/null
+++ b/mysql-php/text/a1.typ
@@ -0,0 +1,15 @@
+#import "/tpl.typ": *
+#show: A => apply(A)
+#set raw(lang: "php")
+#set par(leading: 0.725em)
+
+#assignment(1)[
+  Create a table `Student` in a MySQL database containing the fields `name`, `roll`, `city`, `email` and `date_of_birth` and insert 5 records into this table and display them using PHP.
+]
+
+#scos(1)[
+    === Form page
+    #align(center, image("/output/1/1.png", width: 60%))
+    === Display record
+    #image("/output/1/2.png", width: 100%)
+]
diff --git a/mysql-php/text/a2.typ b/mysql-php/text/a2.typ
new file mode 100644
index 0000000..989f30f
--- /dev/null
+++ b/mysql-php/text/a2.typ
@@ -0,0 +1,12 @@
+#import "/tpl.typ": *
+#show: A => apply(A)
+#set raw(lang: "php")
+#set par(leading: 0.65em)
+
+#assignment(2)[
+  Write a PHP script to insert the records in the table in Assignment 1 and display the records in a separate table of all those students who were born in between `01/01/2000` to `31/12/2005`.
+]
+
+#scos(2)[
+    #image("/output/2.png", width: 100%)
+]
diff --git a/mysql-php/tpl.typ b/mysql-php/tpl.typ
new file mode 100644
index 0000000..1179925
--- /dev/null
+++ b/mysql-php/tpl.typ
@@ -0,0 +1,53 @@
+#import "@preview/codelst:1.0.0": sourcefile
+#let hlfile(filename) = sourcefile(read(filename), file: filename)
+#let apply(body) = {
+  let body-font-settings = (font: "Nunito Sans 10pt", size: 12pt, stretch: 75%)
+//  let body-font-settings = (font: "Hanken Grotesk", size: 12pt, stretch: 75%)
+  let page-margin = (left: 0.75in, right: 0.25in, top: 0.5in, bottom: 0.25in)
+  let margin = (left: 0.75in, right: 0.25in, top: 2em, bottom: 2em)
+  let page-frame-thickness = 1.5pt
+  set page(
+    margin: (..page-margin, bottom: margin.bottom + 2em),
+    numbering: "1",
+    background: align(top + start, pad(..margin, rect(width: 100%, height: 100%, stroke: page-frame-thickness + gray))),
+    footer: locate(loc => align(center, move(dy: -margin.bottom + 1em, text(..body-font-settings, size: 9pt, counter(page).display(loc.page-numbering())))))
+  )
+  show: block.with(breakable: true, width: 100%, inset: page-frame-thickness + 1em)
+  
+  set text(..body-font-settings)
+
+  let code-color = rgb("#f4f4f4")
+//  show raw: set text(font: "CommitMono", size: 1.1em)
+//  show raw: set text(font: "Source Code Pro", size: 1.1em)
+  show raw: set text(font: "Iosevka Fixed", size: 10pt)
+  show raw.where(block: false): box.with(
+    fill: code-color,
+    inset: (x: 3pt, y: 0pt),
+    outset: (y: 3pt),
+    radius: 2pt,
+  )
+  show raw.where(block: true): block.with(
+    fill: code-color,
+    inset: 10pt,
+    radius: 4pt,
+    width: 100%,
+  )
+  show raw.where(block: true): it => align(left, it)
+  set raw(theme: "vendor/gr.tmTheme")
+  set par(leading: 0.6em)
+  body
+}
+
+#let assignment(number, description) = align(center, [
+= #text(weight: 600, [Assignment #number])
+== #text(weight: 500, [Program description:]) #text(weight: 400, description)
+])
+#let objective(body) = align(center, [*Objective*: #body])
+#let oset(kind) = block(spacing: 0.6em, [===== #h(1em) #kind])
+
+#let scos(n, obody) = {
+    [=== Source Code]
+    hlfile("/code/a" + str(n) + ".php")
+    [=== Output]
+    obody
+}
diff --git a/mysql-php/vendor/gr.tmTheme b/mysql-php/vendor/gr.tmTheme
new file mode 100644
index 0000000..c4ab8f1
--- /dev/null
+++ b/mysql-php/vendor/gr.tmTheme
@@ -0,0 +1,566 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

+<plist version="1.0">

+<dict>

+	<key>author</key>

+	<string>Template: Chris Kempson, Scheme: Alexandre Gavioli (https://github.com/Alexx2/)</string>

+	<key>name</key>

+	<string>Base16 Grayscale Light</string>

+	<key>semanticClass</key>

+	<string>theme.base16.grayscale-light</string>

+	<key>colorSpaceName</key>

+	<string>sRGB</string>

+	<key>gutterSettings</key>

+	<dict>

+		<key>background</key>

+		<string>#e3e3e3</string>

+		<key>divider</key>

+		<string>#e3e3e3</string>

+		<key>foreground</key>

+		<string>#ababab</string>

+		<key>selectionBackground</key>

+		<string>#b9b9b9</string>

+		<key>selectionForeground</key>

+		<string>#525252</string>

+	</dict>

+	<key>settings</key>

+	<array>

+		<dict>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#f7f7f7</string>

+				<key>caret</key>

+				<string>#464646</string>

+				<key>foreground</key>

+				<string>#464646</string>

+				<key>invisibles</key>

+				<string>#ababab</string>

+				<key>lineHighlight</key>

+				<string>#ababab55</string>

+				<key>selection</key>

+				<string>#b9b9b9</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Text</string>

+			<key>scope</key>

+			<string>variable.parameter.function</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Comments</string>

+			<key>scope</key>

+			<string>comment, punctuation.definition.comment</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#777777</string>

+				<key>fontStyle</key>

+				<string>bold</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Punctuation</string>

+			<key>scope</key>

+			<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#111111</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Delimiters</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Operators</string>

+			<key>scope</key>

+			<string>keyword.operator</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Keywords</string>

+			<key>scope</key>

+			<string>keyword</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#333333</string>

+				<key>fontStyle</key>

+				<string>bold</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Variables</string>

+			<key>scope</key>

+			<string>variable</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#555555</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Functions</string>

+			<key>scope</key>

+			<string>entity.name.function, meta.require, support.function.any-method, variable.function, variable.annotation, support.macro</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#444444</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Labels</string>

+			<key>scope</key>

+			<string>entity.name.label</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#5e5e5e</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Classes</string>

+			<key>scope</key>

+			<string>support.class, entity.name.class, entity.name.type.class</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#666666</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Classes</string>

+			<key>scope</key>

+			<string>meta.class</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Methods</string>

+			<key>scope</key>

+			<string>keyword.other.special-method</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#444444</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Storage</string>

+			<key>scope</key>

+			<string>storage</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#444444</string>

+				<key>fontStyle</key>

+				<string>bold</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Support</string>

+			<key>scope</key>

+			<string>support.function</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Strings, Inherited Class</string>

+			<key>scope</key>

+			<string>string, constant.other.symbol, entity.other.inherited-class</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#333333</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Integers</string>

+			<key>scope</key>

+			<string>constant.numeric</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#000000</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Floats</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#000000</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Boolean</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Constants</string>

+			<key>scope</key>

+			<string>constant</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#000000</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Tags</string>

+			<key>scope</key>

+			<string>entity.name.tag</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Attributes</string>

+			<key>scope</key>

+			<string>entity.other.attribute-name</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Attribute IDs</string>

+			<key>scope</key>

+			<string>entity.other.attribute-name.id, punctuation.definition.entity</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#686868</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Selector</string>

+			<key>scope</key>

+			<string>meta.selector</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Values</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Headings</string>

+			<key>scope</key>

+			<string>markup.heading punctuation.definition.heading, entity.name.section</string>

+			<key>settings</key>

+			<dict>

+				<key>fontStyle</key>

+				<string></string>

+				<key>foreground</key>

+				<string>#686868</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Units</string>

+			<key>scope</key>

+			<string>keyword.other.unit</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Bold</string>

+			<key>scope</key>

+			<string>markup.bold, punctuation.definition.bold</string>

+			<key>settings</key>

+			<dict>

+				<key>fontStyle</key>

+				<string>bold</string>

+				<key>foreground</key>

+				<string>#a0a0a0</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Italic</string>

+			<key>scope</key>

+			<string>markup.italic, punctuation.definition.italic</string>

+			<key>settings</key>

+			<dict>

+				<key>fontStyle</key>

+				<string>italic</string>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Code</string>

+			<key>scope</key>

+			<string>markup.raw.inline</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#8e8e8e</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Link Text</string>

+			<key>scope</key>

+      <string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Link Url</string>

+			<key>scope</key>

+			<string>meta.link</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Lists</string>

+			<key>scope</key>

+			<string>markup.list</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Quotes</string>

+			<key>scope</key>

+			<string>markup.quote</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Separator</string>

+			<key>scope</key>

+			<string>meta.separator</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#b9b9b9</string>

+				<key>foreground</key>

+				<string>#464646</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Inserted</string>

+			<key>scope</key>

+			<string>markup.inserted</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#8e8e8e</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Deleted</string>

+			<key>scope</key>

+			<string>markup.deleted</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Changed</string>

+			<key>scope</key>

+			<string>markup.changed</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Colors</string>

+			<key>scope</key>

+			<string>constant.other.color</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Regular Expressions</string>

+			<key>scope</key>

+			<string>string.regexp</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Escape Characters</string>

+			<key>scope</key>

+			<string>constant.character.escape</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Embedded</string>

+			<key>scope</key>

+			<string>punctuation.section.embedded, variable.interpolation</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Illegal</string>

+			<key>scope</key>

+			<string>invalid.illegal</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#7c7c7c</string>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Broken</string>

+			<key>scope</key>

+			<string>invalid.broken</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#999999</string>

+				<key>foreground</key>

+				<string>#f7f7f7</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Deprecated</string>

+			<key>scope</key>

+			<string>invalid.deprecated</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#5e5e5e</string>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Unimplemented</string>

+			<key>scope</key>

+			<string>invalid.unimplemented</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#ababab</string>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+	</array>

+	<key>uuid</key>

+	<string>uuid</string>

+</dict>

+</plist>

diff --git a/opencv/index.typ b/opencv/index.typ
new file mode 100644
index 0000000..7486ae7
--- /dev/null
+++ b/opencv/index.typ
@@ -0,0 +1,51 @@
+#import "tpl.typ": *
+#show: body => apply(body)
+#let semibold(body) = text(weight: 600, body)
+#text(size: 1.3em, align(center)[#semibold[Practical Assignments] \ _on_ \ #semibold[Image Processing Lab]])
+#set enum(full: true, numbering: (..args) => {
+  let patterns = ("1.", "a)")
+  let pattern = patterns.at(calc.min(args.pos().len(), patterns.len()) - 1)
+  numbering(pattern, args.pos().last())
+})
+
+#set raw(lang: "python")
+#set par(justify: true)
+#set text(size: 10pt)
+
+
++ Write a program to do image format conversion i.e., from RGB to gray, gray to binary, RGB to binary, RGB to HSV, HSV to RGB, RGB to YCbCr and YCbCr to RGB.
++ Write a program to read an image and rotate that image in clockwise and anti-clockwise direction, and display it.
++ Write a program to find the histogram of a gray image and display the histogram.
++ Write a program to perform color separation into R, G, and B from an color image.
++ Write a program to enhance the image in spatial domain using
+  + Image negative
+  + Log transformation
+  + Power law transform
+  + Piecewise linear transform
++ Write a program to enhance the image in spatial domain using histogram equalization method.
++ Write a program to perform the following image enhancement methods:
+  + Brightness enhancement
+  + Brightness suppression
+  + Contrast manipulation
+  + Gray level slicing without background 
++ Write a program to average two images together into a single image. Display the new image.
++ Write a program to compare two images using image subtraction.
++ Write a program to perform the following image arithmetic.
+  + Image addition
+  + Image subtraction
+  + Image multiplication
+  + Image division
++ Write a program to add various types of noise (salt and pepper noise, Gaussian noise) to an image.
++ Write a program to enhance an image using mean filtering, weighted average filtering, median filtering, max/min filtering.
++ Write a program to segment an image using thresolding technique.
++ Write a program to segment an image based on 
+  + Region growing
+  + Region splitting
+  + Region merging
++ Write a program to find the edge of a given image with the following operators.
+  + Difference operator
+  + Robert operator
+  + Prewitt operator
+  + Sobel operator
++ Write a program to read two images `lena.bin` and `peppers.bin`. define a new 256 x 256 image J as follows : the left half of J i.e., the first 128 columns, should be equal to the left half of lena image and the right half of J, i.e., the 129th column through the 256th column should be equal to the right half of pepper image. Show J image.
+
diff --git a/opencv/tpl.typ b/opencv/tpl.typ
new file mode 100644
index 0000000..239197a
--- /dev/null
+++ b/opencv/tpl.typ
@@ -0,0 +1,47 @@
+#import "@preview/codelst:1.0.0": sourcefile
+#let hlfile(filename) = sourcefile(read(filename), file: filename)
+#let apply(body) = {
+//  let body-font-settings = (font: "Nunito Sans 10pt", size: 12pt, stretch: 75%)
+  let body-font-settings = (font: "Hanken Grotesk", size: 12pt, stretch: 75%)
+  let page-margin = (left: 1in, right: 0.5in, top: 0.5in, bottom: 0.25in)
+  let margin = (left: 0.75in, right: 0.25in, top: 2em, bottom: 2em)
+  let page-frame-thickness = 1.5pt
+  set page(
+    margin: (..page-margin, bottom: margin.bottom + 2em),
+    numbering: "1",
+    background: align(top + start, pad(..margin, rect(width: 100%, height: 100%, stroke: page-frame-thickness + gray))),
+    footer: locate(loc => align(center, move(dy: -margin.bottom + 1em, text(..body-font-settings, size: 9pt, counter(page).display(loc.page-numbering())))))
+  )
+  show: block.with(breakable: true, width: 100%, inset: page-frame-thickness + 1em)
+  
+  set text(..body-font-settings)
+
+  let code-color = rgb("#f4f4f4")
+//  show raw: set text(font: "CommitMono", size: 1.1em)
+  show raw: set text(font: "Source Code Pro", size: 1.1em)
+//  show raw: set text(font: "Iosevka Fixed", size: 1.1em)
+  show raw.where(block: false): box.with(
+    fill: code-color,
+    inset: (x: 3pt, y: 0pt),
+    outset: (y: 3pt),
+    radius: 2pt,
+  )
+  show raw.where(block: true): block.with(
+    fill: code-color,
+    inset: 10pt,
+    radius: 4pt,
+    width: 100%,
+  )
+  show raw.where(block: true): it => align(left, it)
+//  set raw(theme: "vendor/gr.tmTheme")
+  set par(leading: 0.6em)
+  body
+}
+
+#let assignment(number) = {
+  set align(center)
+  [== Assignment #number]
+}
+#let objective(body) = align(center, [*Objective*: #body])
+#let oset(kind) = block(spacing: 0.6em, [===== #h(1em) #kind])
+
diff --git a/python/abld b/python/abld
new file mode 100755
index 0000000..1cc9d0d
--- /dev/null
+++ b/python/abld
@@ -0,0 +1,4 @@
+#!/bin/sh
+d=$(dirname a/$1.pdf)
+if [ ! -d $d ]; then mkdir -p $d; fi
+typst ${2:-c} --root $PWD text/$1.typ a/$1.pdf
diff --git a/python/code/1/1.txt b/python/code/1/1.txt
new file mode 100644
index 0000000..827a09a
--- /dev/null
+++ b/python/code/1/1.txt
@@ -0,0 +1,17 @@
+>>> 2 + 3
+5
+>>> 1 + 2 * 3 - 4
+3
+>>> 12 * 5 / 3 * 2
+40.0
+>>> 5 / 8
+0.625
+>>> 23 // 7
+3
+>>> 17 % 5 - 1
+1
+>>> 3 * (4 + 5) + 5
+32
+>>> (2 + (7 + 2) / 3 - 4) / (-2 / 7 + (19 - 3 * 4) / 8)
+1.696969696969697
+
diff --git a/python/code/1/2.txt b/python/code/1/2.txt
new file mode 100644
index 0000000..08c95b5
--- /dev/null
+++ b/python/code/1/2.txt
@@ -0,0 +1,52 @@
+>>> import math
+>>> math.cos(math.pi / 3)
+0.5000000000000001
+>>> math.sin(math.pi / 6)
+0.49999999999999994
+>>> math.tan(math.pi / 4)
+0.9999999999999999
+>>> math.pow(1.123, 0.123)
+1.0143707323622344
+>>> math.exp(379)
+3.959210944514706e+164
+>>> math.log(10, 2)
+3.3219280948873626
+>>> math.hypot(3, 4)
+5.0
+>>> math.hypot(3, 4, 5)
+7.0710678118654755
+>>> math.degrees(math.pi / 4)
+45.0
+>>> math.radians(90) / math.pi
+0.5
+>>> [*(print(i, math.sqrt(i)) for i in range(1, 10))]
+1 1.0
+2 1.4142135623730951
+3 1.7320508075688772
+4 2.0
+5 2.23606797749979
+6 2.449489742783178
+7 2.6457513110645907
+8 2.8284271247461903
+9 3.0
+[None, None, None, None, None, None, None, None, None]>>> math.modf(12.5)
+(0.5, 12.0)
+>>> math.gamma(6)
+120.0
+>>> [math.floor(x) for x in [12.3, -12.3]]
+[12, -13]
+>>> [math.ceil(x) for x in [12.3, -12.3]]
+[13, -12]
+>>> [math.trunc(x) for x in [12.3, -12.3]]
+[12, -12]
+>>> math.cbrt(8), math.cbrt(10)
+(2.0, 2.154434690031884)
+>>> math.dist((1, 1), (2, 3))
+2.23606797749979
+>>> math.dist((1, 1), (5, 4))
+5.0
+>>> math.isqrt(23)
+4
+>>> math.exp2(10)
+1024.0
+
diff --git a/python/code/1/3.txt b/python/code/1/3.txt
new file mode 100644
index 0000000..90ebdbe
--- /dev/null
+++ b/python/code/1/3.txt
@@ -0,0 +1,17 @@
+>>> a, b = 3 + 2j, 4 - 3j
+>>> a + b, a - b, a * b, a / b
+((7-1j), (-1+5j), (18-1j), (0.24+0.68j))
+>>> -a, -b
+((-3-2j), (-4+3j))
+>>> (a + b) / (a - b)
+(-0.4615384615384615-1.3076923076923077j)
+>>> abs(a), abs(b)
+(3.605551275463989, 5.0)
+>>> a.imag, a.real
+(2.0, 3.0)
+>>> a.conjugate(), b.conjugate()
+((3-2j), (4+3j))
+>>> from cmath import phase
+>>> phase(a), phase(b)
+(0.5880026035475675, -0.6435011087932844)
+
diff --git a/python/code/1/4.py b/python/code/1/4.py
new file mode 100644
index 0000000..7579373
--- /dev/null
+++ b/python/code/1/4.py
@@ -0,0 +1,8 @@
+from math import gcd
+a = int(input('Enter first number: '))
+b = int(input('Enter second number: '))
+print('Sum:', a + b)
+print('Product:', a * b)
+print('Difference:', a - b)
+print('GCD:', gcd(a, b))
+
diff --git a/python/code/1/6.py b/python/code/1/6.py
new file mode 100644
index 0000000..e3a3cd0
--- /dev/null
+++ b/python/code/1/6.py
@@ -0,0 +1,4 @@
+a = float(input('Enter first number: '))
+b = float(input('Enter second number: '))
+print('Concatenation of integer parts:', ''.join(str(int(i)) for i in (a, b)))
+print('Sum rounded to 2 decimal places:', round(a + b, 2))
diff --git a/python/code/1/7.py b/python/code/1/7.py
new file mode 100644
index 0000000..37ecfa3
--- /dev/null
+++ b/python/code/1/7.py
@@ -0,0 +1,5 @@
+a = int(input('Enter first number: '))
+b = int(input('Enter second number: '))
+q, r = a // b, a % b
+q1d, r1d = q % 10, r % 10
+print(f'The one’s place digits of quotient and remainder are {"" if q1d == r1d else "not"} equal.')
diff --git a/python/code/2/1.py b/python/code/2/1.py
new file mode 100644
index 0000000..7ccd78f
--- /dev/null
+++ b/python/code/2/1.py
@@ -0,0 +1,27 @@
+def gaussian_sum_even(numbers):
+    assert len(numbers) % 2 == 0
+    start_index, end_index = 0, len(numbers) - 1
+    sum = 0
+    while start_index < end_index:
+        print(numbers[start_index], '+', numbers[end_index])
+        sum += numbers[start_index] + numbers[end_index]
+        start_index += 1
+        end_index -= 1
+    print('Result:', sum)
+
+gaussian_sum_even(list(range(1, 7)))
+
+def gaussian_sum(numbers):
+    start_index, end_index = 0, len(numbers) - 1
+    sum = 0
+    while start_index < end_index:
+        print(numbers[start_index], '+', numbers[end_index])
+        sum += numbers[start_index] + numbers[end_index]
+        start_index += 1
+        end_index -= 1
+    middle_value = numbers[len(numbers) // 2]
+    print(middle_value)
+    sum += middle_value
+    print('Result:', sum)
+
+gaussian_sum(list(range(1, 10)))
diff --git a/python/code/2/2.py b/python/code/2/2.py
new file mode 100644
index 0000000..bb3e9d2
--- /dev/null
+++ b/python/code/2/2.py
@@ -0,0 +1,12 @@
+def is_prime(n):
+    if n < 2: return False
+    for i in range(2, n):
+        if n % i == 0: return False
+    return True
+
+def filter_prime(numbers):
+    return [number for number in numbers if is_prime(number)]
+
+numbers = [int(n) for n in input('Enter a list of numbers: ').split()]
+primes = [number for number in numbers if is_prime(number)]
+print('List of primes:', primes)
diff --git a/python/code/2/3.py b/python/code/2/3.py
new file mode 100644
index 0000000..2a8dd10
--- /dev/null
+++ b/python/code/2/3.py
@@ -0,0 +1,6 @@
+items = [(0, 'd'), (1, 'a'), (2, 'c'), (3, 'b')]
+
+print(max(items, key=lambda it: it[0]))
+print(min(items, key=lambda it: it[1]))
+items.sort(key=lambda x: ord(x[1]) - x[0])
+print(items)
diff --git a/python/code/2/4.py b/python/code/2/4.py
new file mode 100644
index 0000000..21b1bf4
--- /dev/null
+++ b/python/code/2/4.py
@@ -0,0 +1,27 @@
+from random import randrange
+
+def game():
+    secret = randrange(1, 11)
+    for i in range(3):
+        guess = int(input('Enter a guess: '))
+        if guess != secret:
+            print('Wrong guess!', end=' ')
+        else:
+            print(f'Correct guess in {i + 1} {"try" if i == 0 else "tries"}!')
+            return
+        if i != 2:
+            print('Try again.')
+        else:
+            print('Game over!')
+            print(f'Secret value was {secret}')
+
+while True:
+    print('Welcome to number guessing game')
+    print('Try to guess the secret random number between 1 to 10 correctly in 3 tries')
+    game()
+    choice = input('Do you want to try playing again (y/n, default n): ')
+    if choice == '' or choice == 'n':
+        print('Thanks for playing. Bye!')
+        break
+    else:
+        print('Enjoy your next play\n')
diff --git a/python/code/2/5.py b/python/code/2/5.py
new file mode 100644
index 0000000..ba78eec
--- /dev/null
+++ b/python/code/2/5.py
@@ -0,0 +1,35 @@
+import math, sys
+start_day = int(input('Enter the starting day (1 for Sunday, 2 for Monday, ..., 7 for Saturday): '))
+if not (1 <= start_day <= 7):
+    print('Invalid day, must be between 1 and 7, inclusive')
+    sys.exit(1)
+days_in_month = int(input('Enter the number of days in the month: '))
+print('Calender for this month:')
+print(' SUN MON TUE WED THU FRI SAT')
+if start_day == 2:
+    print(' ' * 4, end='')
+else:
+    print(' ' * (4 * (start_day - 1)), end='')
+
+day = 1
+if start_day != 1:
+    for i in range(7 - start_day + 1):
+        print(f' {day:3}', end='')
+        day += 1
+    print()
+    weeks = math.ceil((days_in_month - (7 - start_day + 1)) / 7)
+else:
+    weeks = math.ceil(days_in_month / 7)
+
+class StopIt(Exception): pass
+
+try:
+    for w in range(weeks):
+        for i in range(7):
+            if day > days_in_month:
+                raise StopIt()
+            print(f' {day:3}', end='')
+            day += 1
+        print()
+except StopIt: pass
+print()
diff --git a/python/code/2/6.py b/python/code/2/6.py
new file mode 100644
index 0000000..8013ae4
--- /dev/null
+++ b/python/code/2/6.py
@@ -0,0 +1,11 @@
+line = input('Enter a string: ')
+uppercase_count, lowercase_count, digit_count = 0, 0, 0
+for c in line:
+    if c.isupper(): uppercase_count += 1
+    elif c.islower(): lowercase_count += 1
+    elif c.isdigit(): digit_count += 1
+
+print('Number of')
+print('  Uppercase characters:', uppercase_count)
+print('  Lowercase characters:', lowercase_count)
+print('  Digits:', digit_count)
diff --git a/python/code/2/7.py b/python/code/2/7.py
new file mode 100644
index 0000000..3212851
--- /dev/null
+++ b/python/code/2/7.py
@@ -0,0 +1,9 @@
+size = int(input('Enter pattern size: '))
+if size < 0:
+    print('Invalid size')
+else:
+    print('*' * size)
+    for i in range(size - 2):
+        print('*' + ' ' * (size - 2) + '*')
+    if size > 1:
+        print('*' * size)
diff --git a/python/code/3/3.py b/python/code/3/3.py
new file mode 100644
index 0000000..7f9a98f
--- /dev/null
+++ b/python/code/3/3.py
@@ -0,0 +1,11 @@
+full_name = input("Enter your full name: ")
+space_index = full_name.rfind(' ')
+
+if space_index == -1:
+  print(f"Your name in reverse: {full_name}")
+else:
+  first_name = full_name[:full_name.index(' ')]
+  last_name = full_name[space_index + 1:]
+  print(f"Your name in reverse: {last_name}, {first_name}")
+
+
diff --git a/python/code/3/4.py b/python/code/3/4.py
new file mode 100644
index 0000000..3c0a566
--- /dev/null
+++ b/python/code/3/4.py
@@ -0,0 +1,25 @@
+def our_str_count(s, sub, start=None, end=None):
+    ss = s[slice(start, end)]
+    if len(sub) == 0: return len(ss) + 1
+    elif len(ss) < len(sub): return 0
+    i, l, ls = 0, len(ss), len(sub)
+    count = 0
+    while i < l:
+        if ss[i:i+ls] == sub:
+            count += 1
+            i += ls
+        else:
+            i += 1
+    return count
+
+s = input('Enter a string: ')
+sub = input('Enter substring to count: ')
+idcs = input('Enter starting and ending indices (default: whole string): ')
+if len(idcs) == 0:
+    idcs = (None, None)
+else:
+    idcs = (int(i) for i in idcs.split())
+start, end = idcs
+
+print('Count:', our_str_count(s, sub, start, end))
+
diff --git a/python/code/3/5.py b/python/code/3/5.py
new file mode 100644
index 0000000..7db13a0
--- /dev/null
+++ b/python/code/3/5.py
@@ -0,0 +1,5 @@
+text = input('Enter a line of text: ')
+vowels = set('aeiouAEIOU')
+ctext = ''.join(c for c in text if c not in vowels)
+print('Given text with all vowels removed:', ctext)
+
diff --git a/python/code/3/6.py b/python/code/3/6.py
new file mode 100644
index 0000000..f9b4b99
--- /dev/null
+++ b/python/code/3/6.py
@@ -0,0 +1,27 @@
+import sys
+message = input('Enter message: ')
+key = None
+try:
+    key = int(input('Enter key (1-25, -1 - -25): '))
+except ValueError:
+    print('Invalid key, must be an integer')
+    sys.exit(1)
+
+if key < 0: key += 26
+if not (1 <= key <= 25):
+    print('Invalid key, must be an integer with absolute value between 1 and 25, inclusive')
+    sys.exit(2)
+
+marr = bytearray(message, 'ascii')
+for i in range(len(marr)):
+    c = marr[i]
+    if 64 < c < 64 + 27:
+        c = ((c - 65) + key) % 26 + 65
+    elif 96 < c < 96 + 27:
+        c = ((c - 97) + key) % 26 + 97
+    marr[i] = c
+
+print('Ceesar cipher with k =', key, 'applied to the given message:')
+print(str(marr, encoding='ascii'))
+
+
diff --git a/python/code/3/7.py b/python/code/3/7.py
new file mode 100644
index 0000000..7a17f08
--- /dev/null
+++ b/python/code/3/7.py
@@ -0,0 +1,9 @@
+import sys
+address = input('Enter an E-mail address: ')
+if '@' not in address:
+    print(address, 'is not a valid E-mail address')
+    sys.exit(1)
+at_position = address.rindex('@')
+username, domain = address[:at_position], address[at_position+1:]
+print('Username:', username)
+print('Domain:', domain)
diff --git a/python/index.typ b/python/index.typ
new file mode 100644
index 0000000..98accaf
--- /dev/null
+++ b/python/index.typ
@@ -0,0 +1,224 @@
+#import "tpl.typ": *
+#show: body => apply(body)
+#show heading: set text(font: "New Computer Modern Sans", weight: 450)
+#let semibold(body) = text(weight: 600, body)
+#let roman(body) = text(weight: 400, body)
+// #text(size: 1.3em, font: "New Computer Modern Sans", align(center)[#semibold[Practical Assignments] \ _on_ \ #semibold[Programming in Python Lab]])
+#text(size: 1.3em, font: "New Computer Modern Sans", align(center)[#semibold[Programming in Python Lab]])
+#align(center, text(size: 1.1em)[DSE-B-1 \ Use of user defined functions are encouraged wherever applicable])
+#set enum(full: true, numbering: (..args) => {
+  let patterns = ("1.", "(a)")
+  let pattern = patterns.at(calc.min(args.pos().len(), patterns.len()) - 1)
+  numbering(pattern, args.pos().last())
+})
+#let nntiv = body => [
+  #set text(size: 0.9em, fill: rgb("#777777"))
+  \ #body
+]
+
+#set raw(lang: "python")
+#set par(justify: true)
+#set heading(numbering: "1 ")
+
+#heading(numbering: none)[0 #h(0.25em) Definitions]
+- _Interactive interpreter_ allows the user to run one or more lines of code interactively, immediately showing the result and output of code.
+- _Programs_ are to be written and saved in text files, usually with the file extension `.py`, and run using the Python executable from CLI (Command Prompt or Powershell in Windows, shell in Linux etc.) or the inbuilt IDLE.
+
+= Basic Python Syntax
+
++ Using the Python _interactive interpreter_ as a basic calculator, demonstrate the order of operations using parentheses for arithmetic operations.
++ Using the Python _interactive interpreter_, demonstrate at least 15 functions in the math module.
+  #nntiv[For example, to find the GCD of two numbers, area and perimeter of circle using `math.pi` etc.]
++ Using the Python _interactive interpreter_, demonstrate the use of complex numbers and their operations on them.
+  #nntiv[For example, in finding the modulus and phase angle (amplitude or argument) of a complex number.]
++ Write a Python program to take two numbers from the user and show their the sum, product, difference and the GCD.
++ Write a Python program to demonstrate the use of _regular expressions_ using `re.split`, `re.join`, `re.search` and `re.match` methods from `re` module.
++ Write a program to take two floating point numbers as input from the user. Concatenate the integral parts of the two numbers and display them, also display the sum of the input floating point numbers rounded upto 2 decimal places.
++ Write a program to divide two numbers and check if the digits at one’s place of the quotient and remainder are equal.
+
+= Decision Control Statements
+
++ Write a Python program to calculate the sum a list of number of (i) even length and then (ii) any length, using `while` loop: at each step, add $k$th number from the start and end of the list and display it, for $k$ from $0$ to half the length the list.
+  #nntiv[For example: if the list is `[1, 2, 3, 4, 5, 6]`, the program should output `1 + 6`, `2 + 5`, and `3 + 4` in separate lines, and the result of the addition `21`.]
++ Write a Python program to sperate prime numbers from a given list of numbers and store them in another list.
++ Write a Python program to demonstrate keyword argument `key` of `sum()`, `min()`, `max()`, and `sort()` functions using `lambda`s.
++ Write a Python program to design the following random number guessing game. A random number from 1 to 10 (inclusive) is selected as a secret number, then the user is prompted to guess the number. If the user’s guess matches the secret number, the game ends with an appropriate message, otherwise the user is asked to try again. After 3 unsuccessful guesses, the user loses and the game ends with an appropriate message revealing the secret number. At the end of the game, ask the user whether to play again. (Use the `random` module to obtain the secret number.)
++ Write a Python program to generate the calendar of a month given the start day (`1` for Sunday, `2` for Monday, ... `7` is Saturday) and the number of days in the month.
+  #nntiv[An example:]
+  #[
+    #show raw: block.with(inset: 0pt, fill: white, width: 20em, outset: 0pt)
+    #show: it => align(center, it)
+    ```text
+    Enter the starting day: 5
+    Enter the number of days in the month: 30
+    Calender for this month:
+    SUN MON TUE WED THU FRI SAT
+                      1   2   3
+      4   5   6   7   8   9  10
+     11  12  13  14  15  16  17
+     18  19  20  21  22  23  24
+     25  26  27  28  29  30
+     ```]
++ Write a Python program to take input from user as a string and count the lowercase characters, uppercase characters and digits in it.
++ #table(
+    columns: (1fr, 4em), stroke: none,
+    inset: 0pt, gutter: 0pt,
+    column-gutter: 5pt,
+    [Write a Python program to print the following star pattern of the given size. \
+    #nntiv[Example (with size 4):]],
+    [
+      #set par(leading: 0em)
+      #set block(inset: 0pt, width: 4em, outset: 0pt)
+      ```text
+****
+*  *
+*  *
+****
+```
+  ])
+
+= Strings
+
++ Write a Python program to ask the user for two strings, print a new string where the first string is reversed, and the second string is converted to upper case, only using string slicing and `+` operator.
+  #nntiv[Sample strings: `Pets`, `party`, output: `steP PARTY`.]
++ Write a Python program to from a list of words, join all the words in the odd and even indices to form two strings using list slicing and `join` method.
+  #nntiv[Example: for a list `['abc', 'def', 'ghi', 'jkl', 'mno', 'pqrs', 'tuv', 'wxyz']`, the result are: `'abcghimnotuv'` and `'defjklpqrswxyz'`.]
++ #text(fill: red, sym.convolve)
+  Write a Python program to input your name in a string, separate the first name and last name using the slice operator with negative indexing, and display your name in reverse using a formatted string. 
++ Write a Python program to implement a function that works like `str.count()` method.
++ Write a Python program to take input a string and display it after removing all the vowels.
++ Write a Python program that take a plain text string and generate cyphertext by using $k$th next character with wrap around for each character for a given constant key value $k$.
+  #nntiv[Also known as _Caesar Cipher_. \ Example: for key $k = 23$, the message `"The quick brown fox jumps over the lazy dog."` encrypts to `"Qeb nrfzh yoltk clu grjmp lsbo qeb ixwv ald."`.]
++ Write a Python program to sperate the username and domain name of an email address.
+#{ /*
++ Write a Python program to separate the `local-part` and `domain` of an email address given as per RFC 5322 format for `addr-spec` (§3.4.1):
+  ```text
+    addr-spec       =   local-part "@" domain
+    local-part      =   dot-atom / quoted-string / obs-local-part
+    domain          =   dot-atom / domain-literal / obs-domain
+    dtext           =   %d33-90 /          ; Printable US-ASCII
+                        %d94-126 /         ;  characters not including
+                        obs-dtext          ;  "[", "]", or "\"
+    FWS             =   ([*WSP CRLF] 1*WSP) /  obs-FW
+                                           ; Folding white space
+    ctext           =   %d33-39 /          ; Printable US-ASCII
+                        %d42-91 /          ;  characters not including
+                        %d93-126 /         ;  "(", ")", or "\"
+                        obs-ctext
+    ccontent        =   ctext / quoted-pair / comment
+    comment         =   "(" *([FWS] ccontent) [FWS] ")"
+    CFWS            =   (1*([FWS] comment) [FWS]) / FWS
+    atext           =   ALPHA / DIGIT /    ; Printable US-ASCII
+                        "!" / "#" /        ;  characters not including
+                        "$" / "%" /        ;  specials.  Used for atoms.
+                        "&" / "'" /
+                        "*" / "+" /
+                        "-" / "/" /
+                        "=" / "?" /
+                        "^" / "_" /
+                        "`" / "{" /
+                        "|" / "}" /
+                        "~"
+    atom            =   [CFWS] 1*atext [CFWS]
+    dot-atom-text   =   1*atext *("." 1*atext)
+    dot-atom        =   [CFWS] dot-atom-text [CFWS]
+    qtext           =   %d33 /             ; Printable US-ASCII
+                        %d35-91 /          ;  characters not including
+                        %d93-126 /         ;  "\" or the quote character
+                        obs-qtext
+    quoted-pair     =   ("\" (VCHAR / WSP)) / obs-qp
+    obs-qp          =   "\" (%d0 / obs-NO-WS-CTL / LF / CR)
+    qcontent        =   qtext / quoted-pair
+    quoted-string   =   [CFWS]
+                        DQUOTE *([FWS] qcontent) [FWS] DQUOTE
+                        [CFWS]
+    word            =   atom / quoted-string
+    obs-local-part  =   word *("." word)
+    obs-domain      =   atom *("." atom)
+    obs-dtext       =   obs-NO-WS-CTL / quoted-pair
+    obs-NO-WS-CTL   =   %d1-8 /            ; US-ASCII control
+                        %d11 /             ;  characters that do not
+                        %d12 /             ;  include the carriage
+                        %d14-31 /          ;  return, line feed, and
+                        %d127              ;  white space characters
+  ```
+*/}
+
+= Lists
+
++ Write a Python program to simulate a stack and a queue using lists.
+  #nntiv[Note that the queue deletion operation won’t run in $O(1)$ time.]
++ Write a Python program to find all the odd numbers and numbers divisible by 3 from a list of numbers using list comprehension.
++ Write a Python program to find the second largest number in a list of numbers.
++ Write a Python program to generate a list of numbers `items` using list comprehension as per the following description:
+  $ "items"[ i ] = cases(
+    i^2 quad "if " i "is even",
+    i^3 quad "if " i "is odd",
+  )  $
+  where $i$ denotes the index of the list.
++ Write a Python program to use the `map()` method to square each number in a list.
++ Write a Python program to remove all duplicate items in a list.
+
+= Tuples
+
++ Write a Python program that, given sequences of first and last names, generate a tuple of tuples each of which contains the full name of a person, using the `zip()` function.
++ Write a Python program to create and modify tuples in various ways.
++ Write a Python program to take a nested tuple with the name, Roll No. and marks of some students and find the name of the student having highest marks.
++ Write a Python program to take a list of numbers (both positive and negative) and make a new tuple out from this list with only the positive values.
++ Write a Python program to demonstrate the definition and use of a function taking variable length arguments (scatter and gather) using the `*` symbol.
+
+= Sets
+
++ Write a Python program to remove duplicate items of a list of numbers and duplicate characters in a string using sets.
++ Write a Python program to implement the Jaccard and cosine similarity of two sets using the set union and intersection operations.
++ Write a Python program to show the difference between `set.remove()` and `set.discard()` methods.
++ Write a Python program that creates two sets of even numbers in the range 1 to 10 and composite numbers in the range 1 to 20 to demonstrate the use of `all()`, `issuperset()`, `len()`, `sum()` methods on the sets.
++ Write a Python program that generates a set of prime numbers and another set of odd numbers. Demonstrate the result of union, intersection, difference, symmetric difference operations on these sets.
++ Write a Python program that creates two sets: squares and cubes in the range 1 to 10 to demonstrate the use of `update()`, `pop()`, `remove()`, `add()` and `clear()` methods.
++ Write a Python program to demonstrate the use of frozensets.
+
+= Dictionaries
+
++ Write a Python program to count the word and letter occurrences in a long string of text using dictionaries.
++ Write a Python program to invert a dictionary such the previous keys become values and values become keys.
+  #nntiv[For example: if the initial and inverted dictionaries are `d1` and `d2`, where `d1 = {1: 'a', 2: 'b', 3: 120}`, then `d2 = {'a': 1, 2: 'b', 120: 3}`.]
++ What if the values in 2 are not immutable? Use frozensets, For repeated values, use lists. For example: if `d1 = {1: 'a', 2: 'a', 4: [1, 2]}`, then `d2 = {'a': [1, 2], frozenset([1, 2]): 4}`.
++ Write a Python program with a function to generate the Fibonacci numbers in
+  + Exponential time using the naïve algorithm.
+  + Linear time using dynamic programming (memoization) with a dictionary.
++ Write a Python program to generate a dictionary where each key is a number and the corresponding value is the number’s square using dictionary comprehensions.
++ Write a Python program to store a sparse matrix as a dictionary.
++ Write a Python program that combines lists of keys and values into a dictionary.
+
+= User-Defined Functions
+
++ Write a Python program to implement quick sort and merge sort algorithms to sort lists of numbers.
++ Write a Python program that displays the Pascal’s triangle of a given size.
++ Three positive integers $a$, $b$, and $c$ are Pythagorean triples if $a^2 + b^2 = c^2$. Write a Python program with a function to generate all Pythagorean triples in a certain range.
++ Write two functions that simulate the toss of a fair coin, and the roll of an unbiased $n$ sided die using the `random` module.
++ Modify the previous assignment. Now the coin and the die are not fair, with each outcome having a given probability.
+
+= File Handling; `sys`, `pickle` and `csv` modules
+
++ Basic file operations. Explore the different file modes.
++ Emulate the unix `cp`, `grep`, `cat` programs in Python. In each case, the user should pass the arguments to the program as command line arguments.
++ Use pickle for persistent storage of variables.
+
+= Object Oriented Programming
+
++ Create a `Graph` class to store and manipulate graphs. It should have the following functions:
+  + Read an edge list file, where each edge `(u, v)` appears exactly once in the file as space separated values.
+  + Add and remove nodes and edges.
+  + Print nodes, and edges in a user readable format.
+  + Computes basic statistics of the graph like degree distribution, clustering coefficient, and the number of connected components.
+  + Finding all the neighbors of a node.
+  + Finding all the connected components and storing them as individual Graph objects inside the class.
+  + Finding single source shortest paths using Breadth First Search.
++ Make a `DiGraph` class to handle directed graphs which inherits from the `Graph` class. In addition to all of the functionalities of 1, it should support the following operations
+  + Finding the predecessors and successors of a node.
+  + Creating a new `DiGraph` object where all the edges are reversed.
+  + Finding the strongly connected components.
++ Extend 1 and 2 to handle weighted graphs, and implement Dijkstra’s and Floyd-Warshall algorithms to compute the single source and all pairs shortest paths.
++ Use the graph containers in 1, 2, and 3 to implement additional graph algorithms.
+
+
diff --git a/python/output/1/6.txt b/python/output/1/6.txt
new file mode 100644
index 0000000..b238b5f
--- /dev/null
+++ b/python/output/1/6.txt
@@ -0,0 +1,7 @@
+```
+Enter first number: 12.345
+Enter second number: 678.9999
+Concatenation of integer parts: 12678
+Sum rounded to 2 decimal places: 691.34
+```
+
diff --git a/python/output/2/1.txt b/python/output/2/1.txt
new file mode 100644
index 0000000..81480d1
--- /dev/null
+++ b/python/output/2/1.txt
@@ -0,0 +1,12 @@
+```
+1 + 6
+2 + 5
+3 + 4
+Result: 21
+1 + 9
+2 + 8
+3 + 7
+4 + 6
+5
+Result: 45
+```
\ No newline at end of file
diff --git a/python/output/2/2.txt b/python/output/2/2.txt
new file mode 100644
index 0000000..4c06a26
--- /dev/null
+++ b/python/output/2/2.txt
@@ -0,0 +1,4 @@
+```
+Enter a list of numbers: 1 42 73 23 13 15 17 9 65 48 37 11 4
+List of primes: [73, 23, 13, 17, 37, 11]
+```
diff --git a/python/output/2/4.txt b/python/output/2/4.txt
new file mode 100644
index 0000000..8188169
--- /dev/null
+++ b/python/output/2/4.txt
@@ -0,0 +1,24 @@
+```
+Welcome to number guessing game
+Try to guess the secret random number between 1 to 10 correctly in 3 tries
+Enter a guess: 10
+Wrong guess! Try again.
+Enter a guess: 8
+Wrong guess! Try again.
+Enter a guess: 3
+Wrong guess! Game over!
+Secret value was 5
+Do you want to try playing again (y/n, default n): y
+Enjoy your next play
+
+Welcome to number guessing game
+Try to guess the secret random number between 1 to 10 correctly in 3 tries
+Enter a guess: 8
+Wrong guess! Try again.
+Enter a guess: 3
+Wrong guess! Try again.
+Enter a guess: 4
+Correct guess in 3 tries!
+Do you want to try playing again (y/n, default n): 
+Thanks for playing. Bye!
+```
diff --git a/python/output/2/5.txt b/python/output/2/5.txt
new file mode 100644
index 0000000..35b538d
--- /dev/null
+++ b/python/output/2/5.txt
@@ -0,0 +1,34 @@
+```
+Enter the starting day (1 for Sunday, 2 for Monday, ..., 7 for Saturday): 1
+Enter the number of days in the month: 30
+Calender for this month:
+ SUN MON TUE WED THU FRI SAT
+   1   2   3   4   5   6   7
+   8   9  10  11  12  13  14
+  15  16  17  18  19  20  21
+  22  23  24  25  26  27  28
+  29  30
+```
+```
+Enter the starting day (1 for Sunday, 2 for Monday, ..., 7 for Saturday): 2
+Enter the number of days in the month: 28
+Calender for this month:
+ SUN MON TUE WED THU FRI SAT
+       1   2   3   4   5   6
+   7   8   9  10  11  12  13
+  14  15  16  17  18  19  20
+  21  22  23  24  25  26  27
+  28
+```
+```
+Enter the starting day (1 for Sunday, 2 for Monday, ..., 7 for Saturday): 7
+Enter the number of days in the month: 31
+Calender for this month:
+ SUN MON TUE WED THU FRI SAT
+                           1
+   2   3   4   5   6   7   8
+   9  10  11  12  13  14  15
+  16  17  18  19  20  21  22
+  23  24  25  26  27  28  29
+  30  31
+```
diff --git a/python/output/2/6.txt b/python/output/2/6.txt
new file mode 100644
index 0000000..32f6729
--- /dev/null
+++ b/python/output/2/6.txt
@@ -0,0 +1,7 @@
+```
+Enter a string: Hello World ABCDE 123456
+Number of
+  Uppercase characters: 7
+  Lowercase characters: 8
+  Digits: 6
+```
\ No newline at end of file
diff --git a/python/output/2/7.txt b/python/output/2/7.txt
new file mode 100644
index 0000000..abb9c92
--- /dev/null
+++ b/python/output/2/7.txt
@@ -0,0 +1,24 @@
+```
+Enter pattern size: 4
+****
+*  *
+*  *
+****
+```
+``` 
+Enter pattern size: 5
+*****
+*   *
+*   *
+*   *
+*****
+```
+```
+Enter pattern size: 6
+******
+*    *
+*    *
+*    *
+*    *
+******
+```
diff --git a/python/output/3/3.txt b/python/output/3/3.txt
new file mode 100644
index 0000000..e2163f7
--- /dev/null
+++ b/python/output/3/3.txt
@@ -0,0 +1,9 @@
+```
+Enter your full name: Sudipto Mallick
+Your name in reverse: Mallick, Sudipto
+```
+```
+Enter your full name: Ayush Kumar Shukla
+Your name in reverse: Shukla, Ayush
+```
+
diff --git a/python/output/3/5.txt b/python/output/3/5.txt
new file mode 100644
index 0000000..11fdc1d
--- /dev/null
+++ b/python/output/3/5.txt
@@ -0,0 +1,4 @@
+```
+Enter a line of text: The trend towards remote work has accelerated in recent years, with many companies adopting a hybrid or fully remote model. It offers employees more flexibility and can lead to increased productivity and job satisfaction.
+Given text with all vowels removed: Th trnd twrds rmt wrk hs cclrtd n rcnt yrs, wth mny cmpns dptng  hybrd r flly rmt mdl. t ffrs mplys mr flxblty nd cn ld t ncrsd prdctvty nd jb stsfctn.
+```
diff --git a/python/output/3/6.txt b/python/output/3/6.txt
new file mode 100644
index 0000000..ba5b336
--- /dev/null
+++ b/python/output/3/6.txt
@@ -0,0 +1,12 @@
+```
+Enter message: A quick brown fox jumps over a lazy dog.
+Enter key (1-25, -1 - -25): 5
+Ceesar cipher with k = 5 applied to the given message:
+F vznhp gwtbs ktc ozrux tajw f qfed itl.
+```
+```
+Enter message: F vznhp gwtbs ktc ozrux tajw f qfed itl.
+Enter key (1-25, -1 - -25): -5
+Ceesar cipher with k = 21 applied to the given message:
+A quick brown fox jumps over a lazy dog.
+```
diff --git a/python/output/3/7.txt b/python/output/3/7.txt
new file mode 100644
index 0000000..23b872f
--- /dev/null
+++ b/python/output/3/7.txt
@@ -0,0 +1,9 @@
+```
+Enter an E-mail address: user@example.net
+Username: user
+Domain: example.net
+```
+```
+Enter an E-mail address: abcdefghi
+abcdefghi is not a valid E-mail address
+```
diff --git a/python/sbld b/python/sbld
new file mode 100755
index 0000000..cea7430
--- /dev/null
+++ b/python/sbld
@@ -0,0 +1,2 @@
+#!/bin/sh
+typst ${2:-c} --root $PWD text/s$1.typ a/s$1.pdf
diff --git a/python/tpl.typ b/python/tpl.typ
new file mode 100644
index 0000000..657176d
--- /dev/null
+++ b/python/tpl.typ
@@ -0,0 +1,51 @@
+#import "@preview/codelst:1.0.0": sourcefile
+#let hlfile(filename) = sourcefile(read(filename), file: filename)
+#let apply(body) = {
+//  let body-font-settings = (font: "Nunito Sans 10pt", size: 12pt, stretch: 75%)
+//  let body-font-settings = (font: "Hanken Grotesk", size: 12pt, stretch: 75%)
+//  let body-font-settings = (font: "Lato", size: 11pt)
+  let body-font-settings = (font: "New Computer Modern", size: 12pt, weight: 450)
+  let page-margin = (left: 0.75in, right: 0.25in, top: 0.35in, bottom: 0.15in)
+  let margin = (left: 0.75in, right: 0.25in, top: 2em, bottom: 2em)
+  let page-frame-thickness = 1.5pt
+  set page(
+    margin: (..page-margin, bottom: margin.bottom + 2em),
+    numbering: "1",
+    background: align(top + start, pad(..margin, rect(width: 100%, height: 100%, stroke: page-frame-thickness + gray))),
+    footer: locate(loc => align(center, move(dy: -margin.bottom + 1em, text(..body-font-settings, size: 9pt, counter(page).display(loc.page-numbering())))))
+  )
+  show: block.with(breakable: true, width: 100%, inset: page-frame-thickness + 1em)
+  
+  set text(..body-font-settings)
+
+  let code-color = rgb("#f4f4f4")
+//  show raw: set text(font: "CommitMono", size: 1.1em)
+//  show raw: set text(font: "Inconsolata", size: 1.1em)
+//  show raw: set text(font: "Source Code Pro", size: 1.1em)
+//  show raw: set text(font: "Iosevka Fixed", size: 1.1em)
+  show raw: set text(font: "New Computer Modern Mono", size: 1.2em)
+  show raw.where(block: false): box.with(
+    fill: code-color,
+    inset: (x: 4pt, y: 0pt),
+    outset: (y: 4pt),
+    radius: 2pt,
+  )
+  show raw.where(block: true): block.with(
+    fill: code-color,
+    inset: 10pt,
+    radius: 4pt,
+    width: 100%,
+  )
+  show raw.where(block: true): it => align(left, it)
+  set raw(theme: "vendor/gr.tmTheme")
+  set par(leading: 0.5em)
+  body
+}
+
+#let assignment(number) = {
+  set align(center)
+  [== Assignment #number]
+}
+#let objective(body) = align(center, [*Objective*: #body])
+#let oset(kind) = block(spacing: 0.6em, [===== #h(1em) #kind])
+
diff --git a/python/vendor/gr.tmTheme b/python/vendor/gr.tmTheme
new file mode 100644
index 0000000..c4ab8f1
--- /dev/null
+++ b/python/vendor/gr.tmTheme
@@ -0,0 +1,566 @@
+<?xml version="1.0" encoding="UTF-8"?>

+<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">

+<plist version="1.0">

+<dict>

+	<key>author</key>

+	<string>Template: Chris Kempson, Scheme: Alexandre Gavioli (https://github.com/Alexx2/)</string>

+	<key>name</key>

+	<string>Base16 Grayscale Light</string>

+	<key>semanticClass</key>

+	<string>theme.base16.grayscale-light</string>

+	<key>colorSpaceName</key>

+	<string>sRGB</string>

+	<key>gutterSettings</key>

+	<dict>

+		<key>background</key>

+		<string>#e3e3e3</string>

+		<key>divider</key>

+		<string>#e3e3e3</string>

+		<key>foreground</key>

+		<string>#ababab</string>

+		<key>selectionBackground</key>

+		<string>#b9b9b9</string>

+		<key>selectionForeground</key>

+		<string>#525252</string>

+	</dict>

+	<key>settings</key>

+	<array>

+		<dict>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#f7f7f7</string>

+				<key>caret</key>

+				<string>#464646</string>

+				<key>foreground</key>

+				<string>#464646</string>

+				<key>invisibles</key>

+				<string>#ababab</string>

+				<key>lineHighlight</key>

+				<string>#ababab55</string>

+				<key>selection</key>

+				<string>#b9b9b9</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Text</string>

+			<key>scope</key>

+			<string>variable.parameter.function</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Comments</string>

+			<key>scope</key>

+			<string>comment, punctuation.definition.comment</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#777777</string>

+				<key>fontStyle</key>

+				<string>bold</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Punctuation</string>

+			<key>scope</key>

+			<string>punctuation.definition.string, punctuation.definition.variable, punctuation.definition.string, punctuation.definition.parameters, punctuation.definition.string, punctuation.definition.array</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#111111</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Delimiters</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Operators</string>

+			<key>scope</key>

+			<string>keyword.operator</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Keywords</string>

+			<key>scope</key>

+			<string>keyword</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#333333</string>

+				<key>fontStyle</key>

+				<string>bold</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Variables</string>

+			<key>scope</key>

+			<string>variable</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#555555</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Functions</string>

+			<key>scope</key>

+			<string>entity.name.function, meta.require, support.function.any-method, variable.function, variable.annotation, support.macro</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#444444</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Labels</string>

+			<key>scope</key>

+			<string>entity.name.label</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#5e5e5e</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Classes</string>

+			<key>scope</key>

+			<string>support.class, entity.name.class, entity.name.type.class</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#666666</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Classes</string>

+			<key>scope</key>

+			<string>meta.class</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Methods</string>

+			<key>scope</key>

+			<string>keyword.other.special-method</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#444444</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Storage</string>

+			<key>scope</key>

+			<string>storage</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#444444</string>

+				<key>fontStyle</key>

+				<string>bold</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Support</string>

+			<key>scope</key>

+			<string>support.function</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Strings, Inherited Class</string>

+			<key>scope</key>

+			<string>string, constant.other.symbol, entity.other.inherited-class</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#333333</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Integers</string>

+			<key>scope</key>

+			<string>constant.numeric</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#000000</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Floats</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#000000</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Boolean</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#222222</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Constants</string>

+			<key>scope</key>

+			<string>constant</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#000000</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Tags</string>

+			<key>scope</key>

+			<string>entity.name.tag</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Attributes</string>

+			<key>scope</key>

+			<string>entity.other.attribute-name</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Attribute IDs</string>

+			<key>scope</key>

+			<string>entity.other.attribute-name.id, punctuation.definition.entity</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#686868</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Selector</string>

+			<key>scope</key>

+			<string>meta.selector</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Values</string>

+			<key>scope</key>

+			<string>none</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Headings</string>

+			<key>scope</key>

+			<string>markup.heading punctuation.definition.heading, entity.name.section</string>

+			<key>settings</key>

+			<dict>

+				<key>fontStyle</key>

+				<string></string>

+				<key>foreground</key>

+				<string>#686868</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Units</string>

+			<key>scope</key>

+			<string>keyword.other.unit</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Bold</string>

+			<key>scope</key>

+			<string>markup.bold, punctuation.definition.bold</string>

+			<key>settings</key>

+			<dict>

+				<key>fontStyle</key>

+				<string>bold</string>

+				<key>foreground</key>

+				<string>#a0a0a0</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Italic</string>

+			<key>scope</key>

+			<string>markup.italic, punctuation.definition.italic</string>

+			<key>settings</key>

+			<dict>

+				<key>fontStyle</key>

+				<string>italic</string>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Code</string>

+			<key>scope</key>

+			<string>markup.raw.inline</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#8e8e8e</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Link Text</string>

+			<key>scope</key>

+      <string>string.other.link, punctuation.definition.string.end.markdown, punctuation.definition.string.begin.markdown</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Link Url</string>

+			<key>scope</key>

+			<string>meta.link</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Lists</string>

+			<key>scope</key>

+			<string>markup.list</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Quotes</string>

+			<key>scope</key>

+			<string>markup.quote</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#999999</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Separator</string>

+			<key>scope</key>

+			<string>meta.separator</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#b9b9b9</string>

+				<key>foreground</key>

+				<string>#464646</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Inserted</string>

+			<key>scope</key>

+			<string>markup.inserted</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#8e8e8e</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Deleted</string>

+			<key>scope</key>

+			<string>markup.deleted</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#7c7c7c</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Changed</string>

+			<key>scope</key>

+			<string>markup.changed</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Colors</string>

+			<key>scope</key>

+			<string>constant.other.color</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Regular Expressions</string>

+			<key>scope</key>

+			<string>string.regexp</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Escape Characters</string>

+			<key>scope</key>

+			<string>constant.character.escape</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#868686</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Embedded</string>

+			<key>scope</key>

+			<string>punctuation.section.embedded, variable.interpolation</string>

+			<key>settings</key>

+			<dict>

+				<key>foreground</key>

+				<string>#747474</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Illegal</string>

+			<key>scope</key>

+			<string>invalid.illegal</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#7c7c7c</string>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Broken</string>

+			<key>scope</key>

+			<string>invalid.broken</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#999999</string>

+				<key>foreground</key>

+				<string>#f7f7f7</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Deprecated</string>

+			<key>scope</key>

+			<string>invalid.deprecated</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#5e5e5e</string>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+		<dict>

+			<key>name</key>

+			<string>Unimplemented</string>

+			<key>scope</key>

+			<string>invalid.unimplemented</string>

+			<key>settings</key>

+			<dict>

+				<key>background</key>

+				<string>#ababab</string>

+				<key>foreground</key>

+				<string>#101010</string>

+			</dict>

+		</dict>

+	</array>

+	<key>uuid</key>

+	<string>uuid</string>

+</dict>

+</plist>