Posts

How to implement alarm clock in python?

              Alarm plays an important role in everyday life. If your python program sets your alarm from your input. Here, is the code follows…. How to do it? This program starts from importing the built-in files. One is datetime and another one is time. Next one is winsound to create alarm sound. First step is to create the set_alarm code. Let us get the input from user for hour and minute to set the alarm. It is named as alarm_hour,alarm_minute. Get the time now. Set the alarm time. If the time crosses, make it for tomorrow. Otherwise, set the sound for the alarm time. Code: #import built-in files import datetime import time import winsound   def set_alarm():     # Ask user for alarm time     alarm_hour = int(input("Enter hour (0-23): "))     alarm_minute = int(input("Enter minute (0-59): "))     now = datetime.datetime.now()    ...

How to create a To-Do list in python

               Planning is very important for any task management. Let us create a To-Do list using python. Steps to follow: ·        This program starts with importing a built-in   file ‘os’. ·        F_NAME is the file name. it is assigned with a txt file name. ·        There are three functions. ‘load_it()’,’save_it()’,’show_it()’. ·        ‘load_it()’ opens the file if exists. Otherwise, it displays the error message. ·        ‘save_it()’ opens the file and writes the content which was given by user. ·        ‘show_it()’ displays the todo list tasks. ·        ‘main()’ function displays the options. Based on the user preference, the data is read,write and display accordingly. Code: import os F_NAME = "todolist.t...

How to run the automation scripts in python?

Image
What are automation Scripts?               A code that can be reusable to execute a function in multiple times. It automatically executed without any user intervention. In python, it is stored with ‘.py’ extension. Steps to execute the automation scripts: 1.Python Installation ·        First, make sure that system has python. ·        Just check the version in command prompt. ·        Open the command prompt by giving ‘cmd’ command in search panel. ·        It opens the command prompt. ·        Use the below syntax to check the version. C:\Users\rajeswari jeevananth>python --version Python 3.10.0 2. Set up your Environment for windows ·      Create a project folder. 3. Create the automation script     ...

Maze Solver in C

               It is a classical project. It is implemented by the use of graph traversal algorithm. It mainly finds the path from starting point to the end point. Here, maze is represented as a 2D matrix. Walls are marked as 1 and paths are marked as 0. C implementation: ·        It starts from including header file. ·        First, the rows and columns are defined as 5. ·        Maze is initialized with values. ·        Visited value is created. ·        solveItMaze() function is used to solve the maze. ·        This function is used to visit all the rows and columns to find the path. The path starts from starting point to end point. ·        Main() function checks for path is not equal to 0,0. ·        ...

Student Information System Project using Linked List and BST in C

               Let us create a simple project for Student Information System. It uses a Linked list and Binary Search Tree. //   First, a student structure is created with rollno, name ,marks and a pointer next. #include <stdio.h> #include <stdlib.h> #include <string.h> // Let us   create Student structure typedef struct Student {     int s_rollno;     char s_name[50];     float s_marks;     struct Student *next;    // Self Referential structure } Student; // BST Node structure is created typedef struct BST_Node {     Student *student;     struct BST_Node *left, *right; } BST_Node; Student *head = NULL;    // Linked List head is assigned as NULL BST_Node *root = NULL;    // BST root // create function to memory allocation Student* createStudent(int roll, char nam...

Representation of Graph using adjacency list in C

     This is the next type of graph representation. In the previous post, the adjacency matrix is used to represent the graph. You can visit the below link to access the adjacency matrix. https://rajeeva84.blogspot.com/2026/05/representation-of-graph-using-adjacency.html It makes use of linked list . It uses vertexes. It   #include <stdio.h> #include <stdlib.h>   struct g_Node {     int g_vertex;     struct g_Node* g_next; }; struct Graph {     int num_Vertices;     struct g_Node** adjLists; }; // let us Create a node struct g_Node* createNode(int v) {     struct g_Node* newNode = malloc(sizeof(struct g_Node));     newNode->g_vertex = v;     newNode->g_next = NULL;     return newNode; } // here, is the graph code struct Graph* createGraph(int vertices) {     struct ...

Representation of Graph using adjacency matrix in C

              Graph is a non-linear data structure. It can be represented by adjacency matrix or adjacency list. Let us discuss the methods in detail. This blog post deals with the first method Adjacency matrix. Adjacency matrix:               It is a two-dimensional matrix.it deals with the edges present between nodes.   If the edges found, it assigns the weight as 1. Otherwise, it values it as 0. Code implementation: This code includes the built-in header file. It defines the vertices as 4. A function ‘Display_Matrix()’ is used to represent the graph. ‘main()’ function initialises the graph. It assigns the value for matrix.  Finally,it calls the ‘Display_Matrix’ function to display the output. Code: #include <stdio.h> #define V 4   // Declare the number of vertices void Display_Matrix(int graph[V][V]) {     for (int i = 0; ...