This repository contains Python programs developed for my final practical file in CBSE Class 12th. These programs showcase my understanding and application of various concepts covered during the course.
No extra installations are needed to run the python programs. However, mysql-connector-python
module is required to run the python-sql connectivity programs.
- This program calculates the factorial of a user-input number using functions.
- This program checks if a user-input number is prime or not.
- Calculates the nth term of the Fibonacci series.
- Generates random numbers between 1 and 6.
- Demonstrates variable-length arguments to calculate the product and power of the first 10 numbers.
- Accepts the number of days, converts it to weeks, and handles errors including the
finally
clause.
- Searches for a user-provided word in a given string or sentence.
- Reads and displays file content line by line with words separated by '*'.
- Reads file content and displays the total number of uppercase and lowercase characters.
- Creates a binary file to store Employee Name and Employee Code, allowing the user to display employee names based on the entered code.
11. Student Database
- Creates a binary file to store RollNo, Name, and marks of students, allowing the user to update marks based on the entered RollNo.
- Reads file content line by line and writes it to another file, excluding lines containing the letter 'o'.
- Creates a binary file with emp id, name, and salary, provides a function to update the salary based on employee id.
14. Cursor Position
- Prints cursor position and text according to specific specifications.
- Implements a stack in Python using a list.
- Creates a database MOVIE_DATABASE with a table MOVIE and performs various operations on it.
- Performs queries on the MOVIE table to retrieve information about movies.
- Retrieves yearly statistics from the MOVIE table.
- Updates records in the MOVIE table.
- Performs queries on the Review table based on movie ratings and collection.
- Creates a database named "Store" and displays the list of databases available in MySQL.
- Creates a table named "Products" under the "Store" database with columns for Product name, category, price, and discount.
- Description: Inserts records into the "Products" table and displays all records.
- Increases the price of products whose names contain the alphabet 'a' and displays the number of updated records.
To run a specific program, navigate to its directory and execute the following command:
python program_name.py
Replace program_name.py
with the name of the Python file you want to run.
-
MySQL Command-Line:
-
Open a terminal or command prompt.
-
Connect to your MySQL server using the following command, replacing
[username]
with your MySQL username and[password]
with your password:mysql -u [username] -p
-
Enter your password when prompted.
-
-
Execute SQL Script:
-
Run the SQL script using the following command, replacing
[path/to/sql/script.sql]
with the path to your SQL script:source /path/to/sql/script.sql
-
Warning
The Review
table creation queries needed to run the last sets of queries is not provided in the script.
This repository is licensed under the MIT License.
Jairaj K. Bhuyan (GitHub: Smoki-Cool)