-->

ABOUT US

Our development agency is committed to providing you the best service.

OUR TEAM

The awesome people behind our brand ... and their life motto.

  • Kumar Atul Jaiswal

    Ethical Hacker

    Hacking is a Speed of Innovation And Technology with Romance.

  • Kumar Atul Jaiswal

    CEO Of Hacking Truth

    Loopholes are every major Security,Just need to Understand it well.

  • Kumar Atul Jaiswal

    Web Developer

    Techonology is the best way to Change Everything, like Mindset Goal.

OUR SKILLS

We pride ourselves with strong, flexible and top notch skills.

Marketing

Development 90%
Design 80%
Marketing 70%

Websites

Development 90%
Design 80%
Marketing 70%

PR

Development 90%
Design 80%
Marketing 70%

ACHIEVEMENTS

We help our clients integrate, analyze, and use their data to improve their business.

150

GREAT PROJECTS

300

HAPPY CLIENTS

650

COFFEES DRUNK

1568

FACEBOOK LIKES

STRATEGY & CREATIVITY

Phasellus iaculis dolor nec urna nullam. Vivamus mattis blandit porttitor nullam.

PORTFOLIO

We pride ourselves on bringing a fresh perspective and effective marketing to each project.

  • Multiplication table of user input in React js

     

    Multiplication table of user input in React js

     

    Multiplication table of user input in React js

     

    Today in this blog we will aware about Multiplication table means how to generate table of 5, 6, 7, 8 etc in react js but this time we will generate table by user input so dont waste time lets do it but lets recap what is exactly React js.


    React

    Certainly! ReactJS is a JavaScript library developed by Facebook for building user interfaces. It allows developers to create reusable UI components and efficiently manage the state of their applications. Here are some key aspects of ReactJS:
     

    Component-Based Architecture: ReactJS follows a component-based architecture, where the user interface is divided into small, reusable components. Components encapsulate their own logic, state, and rendering, making it easier to build and maintain complex user interfaces.
     

    Virtual DOM: ReactJS uses a virtual representation of the DOM (Document Object Model), known as the Virtual DOM. When the state of a component changes, React updates the Virtual DOM.
     

    JSX: JSX is a syntax extension for JavaScript used in React. It allows developers to write HTML-like code within JavaScript, making it easier to describe the structure and appearance of components. JSX code is transpiled to regular JavaScript using tools like Babel before being executed in the browser.

     
    Hooks: React introduced Hooks in version 16.8 as a way to use state and other React features in functional components. Hooks allow developers to write reusable logic and manage state within functional components without the need for class components. The most commonly used hooks are useState for managing state and useEffect for handling side effects such as fetching data or subscribing to events.
     

    React Router: React Router is a popular routing library for React applications. It enables developers to create single-page applications with multiple views and handles routing between different components based on the URL.
     

    State Management: React provides a flexible ecosystem of state management solutions. While React's built-in state management (useState ) is suitable for managing local component state, more complex applications may benefit from additional state management libraries like Redux. These libraries help manage global application state and provide predictable ways to update and access the state.

    ReactJS has gained widespread popularity due to its performance, reusability, and declarative approach to building user interfaces. It has large community.



    NOTE - Here we will Tailwind CSS for designing..


    Generating Table

     

    To create a multiplication table of 5 in ReactJS based on user input, you can follow these steps:
     

    # Set up a React component with a state to track the user input and the resulting multiplication table.
    # Render an input field where the user can enter a number.
    # Add an event handler to capture the user input and update the component's state.
    # Use the entered number to generate the multiplication table and store it in the component's state.
    # Render the multiplication table below the input field.

    Here's an example implementation:



    import React, { useState } from 'react'
    
    function Table() {
    
    const [number, gettbl] = useState('');
    
    const rows = [];
        for(let i = 1; i <= 10; i++)
        {
        rows.push(
            <tr key={i}> 
            <td className='text-red-600 ' >{number} * {i} =  {i * number }</td>
           
            </tr>
        );
        }
    
    for(let i = 1; i <= 10; i++) {
        const result = i * number;
        console.log(`${number} * ${i} = ${result}`);
    }
         
    const getTable = (event) => {
        gettbl(event.target.value);   // for updating the value
    }
    
      
    
      return (
        <div className="">
        <div className="grid justify-center  grid-cols-1 lg:grid-cols-2 gap-2 mt-48  h-96 ml-[40%]  ">
           
          <div className="w-full max-w-xs mt-auto md:grid-rows-6 ">
    <form className="bg-white shadow-md rounded px-8 pt-6 pb-8 mb-4"
    
    >
      <div className="mb-4">
        
        
        <label className="block text-gray-700 text-sm font-bold mb-2" htmlFor="number">
        Number
        </label>
    
        <input className="shadow appearance-none border rounded w-full py-2 px-3 text-gray-700 leading-tight focus:outline-none focus:shadow-outline" 
        type="number" 
        placeholder="Enter Number For Table" 
        onChange={getTable }
        name="number"
         /> 
    
      </div>
      <div className='mt-3 flex px-auto  ' >
      <p>{rows}</p>
      </div>
    </form>
     
    </div>
        </div>
      </div>
    );
    }
       
    export default Table
    



     


     

    This component maintains the "number" state to store the user input and the "gettbl" state to store the generated multiplication table. The "getTable" function is called whenever the user enters a number. It updates the number state and generates the multiplication table using the "Table" function. The resulting table is stored in the table state and rendered in the table element below the input field.


    Here rows.push is that Appends new elements to the end of an array, and returns the new length of the array.   

    Remember to include this component in your main application and render it where desired.

     

     

    Read More - How to add loader or spinner in react js?


    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • How to add loader or spinner in reactjs

     

    How to add loader or spinner in reactjs

     

    How to add loader or spinner in reactjs


    React Loader Spinner is a library for adding loading spinners or progress indicators to React applications. It provides a set of customizable spinner components that can be used to indicate that a particular operation is in progress, such as loading data or performing an asynchronous task.


    React Loader Spinner offers a wide range of spinner types, including classic spinners like a circle or bar, as well as more complex ones like a pulsating circle or a rotating cube. The library is highly configurable, allowing you to customize the size, color, and animation speed of the spinners.


    React Loader Spinner is designed to be easy to use and integrate into React projects. It can be installed via npm and imported into your React components. Once imported, you can simply add the desired spinner component to your JSX code and configure its props to suit your needs.
    In summary, React Loader Spinner is a useful library for adding loading spinners to React applications, providing a variety of customizable spinner types and making it easy to integrate them into your code.
     

    To add a loader spinner in a React project, you can use an existing library like react-loader-spinner or create your own spinner component.

    Here's an example of how to use the react-loader-spinner library:

     

     First Search on Browser "React loader spinner"

     

     

    How to add loader or spinner in reactjs

     

    then as you can see there, there is a first link of npmjs.com, open it. But dont worry i will provide you direct link (check below)

    https://www.npmjs.com/package/react-loader-spinner

     

     
    After opening it, this is a page of npmreactjs official site so where we can install any type of package library so copy from here pkg

    npm i react-loader-spinner

     

    How to add loader or spinner in reactjs

     

     

     
    Then, in your vs code terminal paste it and install it

     

     

    How to add loader or spinner in reactjs

     

     So as you can see installation done so whether is it install or not to check it in your "package.json"

     

    How to add loader or spinner in reactjs

     

     

     Now finally after installation of pkg library we will follow some steps to complete the project

    Step 1 - Then, we will do all type of coding in "App.jsx" file. So import the pkg first. 


    import { Circles } from 'react-loader-spinner';



    Step 2 - Now  we will use useEffect() hooks inside "function App()" and useState() too.



      const [loading, setLoading] = useState(false)
      useEffect(() => {
        setLoading(true)
        setTimeout(() => {
          setLoading(false)
        }, 2000)
      }, [])
    
    
    



    This code will render a TailSpin spinner with timeout of 2 seconds (1000 ms = 1 sec).



    Step 3 - Now we import useState and useEffect after importing react-loader-spinner


    import { useState, useEffect } from 'react';


    Step 4 - Now inside return, we will write react loader circle and adding some content for displaying after loading the circle spinner.



    <div className='App'>
    {
     loading ? 
     <Circles color={'#D0021B'} loading={loading} size={100} />
     :
    
      <div>
      <h1>Hello World </h1/>
      <p>Myself Kumar Atul Jaiswal CEO and Founder of Hacking Truth. </p>
     </div>
    }
    
    
    </div>
    




    This code will render a TailSpin spinner with #D0021B color, 100px height and width and loading is true when your page is refreshing.


    Full Code



    import React from 'react'
    import { Circles } from 'react-loader-spinner';
    import { useState, useEffect } from 'react';
    
    
    function App() {
    
      const [loading, setLoading] = useState(false)
      useEffect(() => {
        setLoading(true)
        setTimeout(() => {
          setLoading(false)
        }, 2000)
      }, [])
     
    
    
      return (
        <div>
         
         
       <div className='App'>
       {
        loading ? 
        <Circles color={'#D0021B'} loading={loading} size={100} />
        :
    
        <div className='flex-1' >
        <h1>Hello World</h1>
        <p>Myself Kumar Atul Jaiswal CEO and Founder of Hacking Truth and She is miss Khushboo Kashyap Co-Founder of Hacking Truth</p>
        </div>
       }
    
     
      </div>
     
        
        </div>
      )
    }
    
    export default App
    



    How to add loader or spinner in reactjs


    Result -


    How to add loader or spinner in reactjs


    If you have any components... so use it like this



    import Navbar from './components/Navbar';
    import { Route, Routes } from "react-router-dom";
    import Discover from "./components/Discover";
    
    import Signin from "./components/Signin";
    import Dashboard from './components/Dashboard';
    import Profileupdating from './components/Profileupdating';
    
    import 'react-toastify/dist/ReactToastify.css';
    
    import { Circles, ThreeDots  } from 'react-loader-spinner';
    import { useEffect, useState } from 'react'; 
    
    
    function App() {
    
      const [loading, setLoading] = useState(false)
      useEffect(() => {
        setLoading(true)
        setTimeout(() => {
          setLoading(false)
        }, 2000)
      }, [])
     
    
    
      return (
        <div>
         
         
       <div className='App'>
       {
        loading ? 
        <Circles color={'#D0021B'} loading={loading} size={100} />
        :
    
       
       
        <>
    
        <Navbar />
    
    <Routes>
      {/* <Route path='/' element={ <Home /> } /> */}
      <Route path='/' element={<Signin />} />
      <Route path='/discover' element={<Discover /> } />
    
      <Route path='/dashboard' element={<Dashboard />} />
      <Route path='/signin/:id' element={<Signin /> } />
      <Route path='/profileupdating/:id' element={<Profileupdating /> } />
      
       
    </Routes>
    
    </>
    
       }
    
     
      </div>
     
        
        </div>
      )
    }
    
    export default App
    
    




    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • Why we need of Virtualization technology



     

    Why we need of Virtualization technology ?

     

    Virtualization technology is a way to create multiple virtual versions of a physical computer or other hardware resources, such as a server or network. This is done by using specialized software, called a hypervisor or virtual machine monitor, which creates a layer of abstraction between the hardware and the virtual machines.

    Virtualization technology allows multiple operating systems to run on a single physical machine simultaneously, without interfering with each other. Each virtual machine has its own virtualized hardware, including CPU, RAM, storage, and network interfaces, and can run its own applications and services as if it were a physical machine.

    Virtualization technology has many benefits, including improved hardware utilization, easier software deployment, increased flexibility, and improved disaster recovery capabilities. It is widely used in data centers and cloud computing environments, as well as in desktop and mobile computing environments.



    How to enable virtualization technology in bios?


    The steps to enable virtualization technology in BIOS may vary slightly depending on the motherboard and BIOS version, but generally, the following steps should work:

       

    # Start or restart your computer and enter the BIOS setup by pressing the appropriate key during the boot process (this key is usually displayed on the screen, and commonly it's F2 or Del key).
     

    # Navigate to the "Advanced" or "System Configuration" or "Security" tab, depending on your motherboard manufacturer and BIOS version.

    # Look for an option called "Intel Virtualization Technology", "Intel VT-x", "Virtualization Extensions", "AMD-V", or something similar.

    # Change the setting to "Enabled" or "On".

    # Save the changes and exit the BIOS setup.

        Restart your computer and the virtualization technology should now be enabled.

    It's important to note that not all CPUs support virtualization technology, and some older motherboards or BIOS versions may not have this option. Also, be aware that enabling .



    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

     

  • GRUB grand unified bootloader

     

    GRUB grand unified bootloader

     

    G-R-U-B

     

    GRUB (short for Grand Unified Bootloader) is a popular boot loader used on many Linux and Unix-like operating systems. It is responsible for loading the operating system kernel and other necessary files, and it is typically the first software component that runs when a computer boots up.

    GRUB provides a menu interface that allows the user to select which operating system or kernel to boot, and it supports a wide range of file systems, including the popular ext4 file system used by many Linux distributions. It also allows users to specify boot options, such as kernel parameters or alternate boot locations.


    Also Read - FAT32 vs NTFS


    One of the advantages of GRUB is its flexibility and configurability. It can be customized to meet specific system requirements, and it is often used as part of the boot process for custom Linux distributions and other specialized systems. Additionally, GRUB is open source software, meaning that its source code is freely available for inspection and modification by developers and users.

     


    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     
  • FAT32 vs NTFS

     

    FAT32 vs NTFS

     

    File system is a structure that helps computer or operating system organize data on hard disk. If you are installing hard disk drive then you have to parallelize and format it, in windows based operating system app usually But there are 2 options available.


    One is fat and the other is nuts

    FAT file allocation table or FAT mark was created by Donald in 1977.


    File size: FAT32 has a maximum file size limit of 4GB, whereas NTFS can support much larger file sizes, up to 16 exabytes (EB).

    Partition size: FAT32 has a maximum partition size of 8TB, while NTFS has a maximum partition size of 256TB.

    And after this FAT32 came and FAT32 means that the data is saved in 32 bits chunks and the new technology file system was created by Microsoft and IBM together, It was introduced in the Windows NT platform in 1993, since then it is seen in the Windows based server operating system Windows XP and subsequent operating systems, so let's take a little more information about these two and between them Also know what is the difference


    In FAT32, the file size can be maximum of 4GB minus 2 bytes, it can create a file of approximately 4GB whereas in NTFS you can.


    You can create a file of 244 bytes or 16 terabytes minus 64 kilobytes, that is, the maximum size of an NTFS file is around 16 terabytes.

    FAT32 systems are less fault tolerant, the operating system maintains 2 copies of the file allocation table and can be restored from a backup if corrupted, such as in case of a power failure, while NTFS provides more fault tolerance. Is and maintains the law of changes in this disk and tries to repair any corruption such as if there is a power failure, NTFS auto repairs the file system and that too in the background so that in most cases Doesn't know if this auto repair feature is repairing NTFS or not



    FAT32 vs NTFS





    Apart from this, FAT32 systems are less secure, only share permissions are available for this security, due to which your systems are secured from the network, that is, the upper stored data of your system can be accessed only with permissions but This does not happen locally and all the files stored on the device that you will be accessing the systems And can use the folder in any way, while NTFS is a very secure system, with the help of file permissions, you can define which users can access the locally kept files and folders to what extent. Yes, NTFS provides security both locally and over the network


    FAT32 does not have any compression features i.e. you cannot save space by compressing the data.

    While NTFS provides compression features

    Apart from this, you can convert your FAT32 system to FAT32 at any time while you cannot convert NTFS to FAT32.

    In NTFS and FAT32 you can choose the file system according to your requirement where FAT32 is simple file system and It is popular in storage media like memory cards, USB pen drives and MP3 players or flash drives because of its simplicity but you need features like security and compression, in our case you have to choose NTFS.

     


    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     

  • Where do you want to be redirected 301 and 302?

     

    Where do you want to be redirected 301 and 302?


    301 and 302?


    you have a website you have a domain!! What happens if after a while you decide that you don't like that domain name what do you do ?


    Hello Guys i'm Atul from behalf of Hacking Truth and today i'm going to be explaining how you can use 301 and 302 redirects as well as what's the difference between them so first of!!


    If you have a domain name let's say you started out with  kumaratuljaiswal.in  and you decided you know what i have these sixteen letter domain names they're too long i actually want a two letter domain name i just want kumaratuljaiswal.in if you decide that it's too long and you're gonna change from kumaratuljaiswal.in to kumaratul.in you wanna do what's called a 301 redirect a 301 redirect tells google that hey we've changed names we have a new domain name take all our existing rankings from this site and transfer it  over to this new site and they do that it roughly takes anywhere from a few weeks to sometimes up to a few months to fully kick in but when you do a 301 redirect you're telling
    google we've permanently moved.

     

    Think of it as changing an address when you move locations a new apartment a new home you're telling the postal service that hey i've changed locations and now they forward all mail to your new address the same thing happens when you use a 301 redirect a 302 redirect on the other hand is telling google hey we've temporarily changed locations think of it as you're going to a summer home and you're staying there so you want your mail forwarded there for a few months and then you're going to go back to your original home that's the same way it works on the web with the 302 redirect in which let's say you offer winter products and summer products so your domain name is kumaratuljaiswal.in/summer and you
    decide that hey summer's over we're now going to shift into winter products well you can do a 302 redirect saying hey we've moved kumaratuljaiswal.in/summer to kumaratuljaiswal.in/winter that tells google hey temporarily send all the traffic and the rankings etc to kumaratuljaiswal.in/winter now in the eyes of google they said recently that they start looking at 301 redirects and 302 redirects the same but not all search engines do this if you do a permanent move use a 301 and if you're doing a temporary move use a 302 redirect.




    You can do this for whole domain names and you can do this for web URLs as well so it could be web pages on your site subdirectory subdomains etc if you're going to do this i could say hey here's how to
    do it but i don't recommend that you actually do the redirects yourself unless you're technical i did this with my own website kumaratuljaiswal.in/br i made a mistake with my 301 redirects and you know what i eventually fixed it but my traffic didn't bounce back it went to 90 percent of where it was it took roughly 3 months to recuperate most the traffic.



    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • lab based on python assignment M.C.A 3rd sem


    lab based on python assignment M.C.A 3rd sem

     

    Python is a general purpose programming language that is often applied in scripting roles.So, Python is programming language as well as scripting language. Python is also called as Interpreted language.

    Lets start with question no 1 python assignment.


    1. Write a program to create a class, constructor and functions to accept and display the values.



    #!/usr/bin/python3
    
    class Atul:
    
         def __init__(self):
              self.x = input("Enter firstname ")
              self.y = input("Enter lastname ")
         def show(self):
             print("Your firstname is : " , self.x)
             print("Your lastname is : " , self.y)
    
    obj = Atul()
    obj.show()
    
    
    
    


    lab based on python assignment M.C.A 3rd sem


    2. WAP using Dictionary to store userid and password and validate the user based on userid and password.



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat second.py       
    #!/usr/bin/python3
    
    from getpass import getpass
    import time
    
    a = input("Enter username ")
    b = getpass("Enter password ")
    
    #key = [1, 2, 3]
    #value = {"java", "android", "web development"}
    
    stored = dict.fromkeys({a},b)
    
    #print(stored)
    
    
    
    username = input("Enter username : ")
    
    if username in stored:
       password = input("Enter password : ")
       if stored[username] == password :
          print("Please wait a seond for checking userid and password...")
          time.sleep(2)
          print("Username and password match")
       else:
          print("user entered the wrong password")
    else:
        print("your username is not registered")
    
    
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ 
    
    


    lab based on python assignment M.C.A 3rd sem


    3. Write a program to create a user defined exception in python and handle the exception using user defined class.



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat third3.py 
    class ValueError(Exception):
        pass
    try:
        age= 10
        print("Age is:")
        print(age)
        if age<=0:
            raise ValueError
        yearOfBirth= 2021-age
        print("Year of Birth is:")
        print(yearOfBirth)
    except ValueError:
        print("Input Correct age.")
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ 
    
    



    lab based on python assignment M.C.A 3rd sem


    4. Write a program to start different executable files of system such as calculator, notepad, msword etc.



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat fourth2.py
    #!/usr/bin/python3
    
    import os
    import subprocess
    
    def Exitapp():
         exit()
    
    application = []
    while(True):
           print("1 for notepad.exe ")
           print("2 for calc.exe ")
           print("3 for notepad.exe ")
           print("4 for cmd.exe ")
           print("5 for exit ")
    
    
    name = int(input("Enter your choice"))
    
    if(num == 1):
        os.system(application)
    elseif(num == 2):
        os.system(application)
    elseif(num == 3):
        os.system(application)
    elseif(num == 4):
        os.system(application)
    elseif(num == 5):
        Exitapp()
    
    
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ 
    
    


     

    5. Write a menu-driven program to find the area of a circle, square and rectangle in python.



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat fifth.py  
    #!/usr/bin/python3
    import sys
    import os
    from colorama import Fore, Back, Style
    
    print("\n****************************************")
    print("Menu Driven Program")
    print(Fore.LIGHTWHITE_EX + "1 For Area of Circle")
    print(Fore.LIGHTGREEN_EX + "2 For Area of Square")
    print(Fore.LIGHTWHITE_EX + "3 For Area of Rectangle")
    print(Fore.LIGHTGREEN_EX + "4 For Quit")
    print("****************************************\n")
    
    
    num=int(input("Enter your choice:"))
    
    if num==1:
       radius=int(input("Enter radius of Circle:"))
       print("Area of Circle",3.14*radius*radius)
         
    elif num==2:
         length=int(input("Enter length of Rectangle:"))
         breadth=int(input("Enter breadth of Rectangle:"))
         print("Area of Rectangle:",length*breadth)
         
    elif num==3:
         side=int(input("Enter side of Square:"))
         print("Area:",side*side)
    
    elif num==4:
         sys.exit() #break
    else:
         print("Wrong Choice")
    
    repeat=input("Do you want to continue? (y/n)")
    if repeat=='n'or repeat=='N':
        sys.exit() #break
    else:
        os.system("python3 fifth.py")
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ 
    
    



    6. Write a program to insert, update, delete and display the values using dictionary in python.

     

    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat sixth.py 
    #!/usr/bin/python3
    
    import time
    
    a = input("Enter the key attribute : ")
    b = input("Enter the value of key attribute : ")
    
    dict = {}
    
    
    
    #for insert an element
    
    dict_append = ({a,b})
    #key = [a, a, a]
    #print(dict_append, key)
    print(dict_append)
    
    print("Please wait a second")
    time.sleep(2)
    print("Now we will use update")
    
    #for update an element
    stored = dict.update({a:b})
    dict['salary'] = 1000
    print("Updated Dict is: ", dict)
    print(stored)
    
    
    #for delete an element
    sixMonths = {1:31, 2:28, 3:31, 4:30, 5:31, 6:"joker"}
    print(sixMonths.popitem())
    print(sixMonths)
    
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ 
    
    

     

     

    lab based on python assignment M.C.A 3rd sem

     

     

    7. Create a Digital clock using tkinter in python.

     


    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat seventh.py
    #!/usr/bin/python3
    
    from tikinter import *
    import time
    
    win = Tk()
    win.title("Digital Clock")
    win.geometry("400 x 150")
    label = label(win.font="Arial", 60, "bold", bg="yellow", font="red", col=25)
    
    label.grid(row=0, column=1)
    
    def clock():
        t1.time.strftime("%H:%M%S")
        label.config(text=t1)
        label.after(1000, clock)
    
    clock()
    win.mainloop()
    
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ 
    
    
    

     

     

    8. Write a program to insert, delete and displaying elements in ascending and descending order using List data type in python.

     

    # List implementation to perform insert, delete and display operations in ascending and descending order
    
    # function to insert elements in the list
    def insert_elements(my_list, element):
        my_list.append(element)
        print("Element inserted successfully.")
    
    # function to delete elements from the list
    def delete_element(my_list, element):
        if element in my_list:
            my_list.remove(element)
            print("Element deleted successfully.")
        else:
            print("Element not found in the list.")
    
    # function to display elements in ascending order
    def display_ascending_order(my_list):
        my_list.sort()
        print("Elements in ascending order:")
        print(*my_list)
    
    # function to display elements in descending order
    def display_descending_order(my_list):
        my_list.sort(reverse=True)
        print("Elements in descending order:")
        print(*my_list)
    
    # main function
    def main():
        my_list = []
        while True:
            print("1. Insert elements")
            print("2. Delete elements")
            print("3. Display elements in ascending order")
            print("4. Display elements in descending order")
            print("5. Exit")
            choice = int(input("Enter your choice: "))
            if choice == 1:
                element = int(input("Enter the element to be inserted: "))
                insert_elements(my_list, element)
            elif choice == 2:
                element = int(input("Enter the element to be deleted: "))
                delete_element(my_list, element)
            elif choice == 3:
                display_ascending_order(my_list)
            elif choice == 4:
                display_descending_order(my_list)
            elif choice == 5:
                break
            else:
                print("Invalid choice.")
    
    # driver code
    if __name__ == '__main__':
        main()
    
    

     

     

    9. Write a program to create a PhoneBook using Dictionary for adding, updating, searching and deleting phone Numbers.

     

    # PhoneBook using Dictionary
    
    # function to add a new contact to the phonebook
    def add_contact(phonebook, name, number):
        phonebook[name] = number
        print("Contact added successfully.")
    
    # function to update an existing contact in the phonebook
    def update_contact(phonebook, name, number):
        if name in phonebook:
            phonebook[name] = number
            print("Contact updated successfully.")
        else:
            print("Contact not found.")
    
    # function to search for a contact in the phonebook
    def search_contact(phonebook, name):
        if name in phonebook:
            print(name, ":", phonebook[name])
        else:
            print("Contact not found.")
    
    # function to delete a contact from the phonebook
    def delete_contact(phonebook, name):
        if name in phonebook:
            del phonebook[name]
            print("Contact deleted successfully.")
        else:
            print("Contact not found.")
    
    # main function
    def main():
        phonebook = {}
        while True:
            print("1. Add Contact")
            print("2. Update Contact")
            print("3. Search Contact")
            print("4. Delete Contact")
            print("5. Exit")
            choice = int(input("Enter your choice: "))
            if choice == 1:
                name = input("Enter name: ")
                number = input("Enter phone number: ")
                add_contact(phonebook, name, number)
            elif choice == 2:
                name = input("Enter name: ")
                number = input("Enter phone number: ")
                update_contact(phonebook, name, number)
            elif choice == 3:
                name = input("Enter name: ")
                search_contact(phonebook, name)
            elif choice == 4:
                name = input("Enter name: ")
                delete_contact(phonebook, name)
            elif choice == 5:
                break
            else:
                print("Invalid choice.")
    
    # driver code
    if __name__ == '__main__':
        main()
    
    

     

     

    10. WAP in python to store students details in csv file.

     

     

    #!/usr/bin/python
    
    import csv 
    
    header = ['sname', 'class', 'roll no', 'subject']
    
    data = [['Atul', 'MCA', 67], ['Khushboo', 'MCA', 64], ['Priya', 'MCA', 64], ['Tinki', 'MCA', 14], ['Umesh', 'MCA', 66], ['Muskan', 'MCA', 8], ['Sweta', 'MCA', 9]]
    
    filename = 'student_data.csv'
    
    with open(filename, 'w') as file:
         for header in header:
             file.write(str(header) + ', ')
         file.write('\n')
         for row in data:
             for x in row:
                 file.write(str(x) + ',')
                 file.write('\n')
    
    

     

     

    11. WAP in python to create a decorator and decorate a function.



    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$ cat eleventh.py                                                                                                                                                 1 ⚙
    #!/usr/bin/python3
    
    def decorator_function(func):
        def wrapper_function(*args, **kwargs):
            print("Wrapper function executed before {}".format(func.__name__))
            result = func(*args, **kwargs)
            print("Wrapper function executed after {}".format(func.__name__))
            return result
        return wrapper_function
    
    @decorator_function
    def display_info(name, age):
        print("Displaying information:")
        print("Name: {}".format(name))
        print("Age: {}".format(age))
    
    display_info("Atul", 30)
                                                                                                                                                                            
    ┌──(hackerboy㉿KumarAtulJaiswal)-[~/Desktop/rnc-university-mca/mca-3rdsem-python]
    └─$                                                                                                                                                                 1 ⚙
    
    
    
    


    12. WAP in python to insert, update, display and delete data in mysql database.



    import mysql.connector
    
    # Connect to the database
    conn = mysql.connector.connect(
        host="hostname",
        user="username",
        password="password",
        database="database_name"
    )
    
    # Create a cursor to execute SQL commands
    cursor = conn.cursor()
    
    # Insert data
    sql_insert = "INSERT INTO table_name (column1, column2) VALUES (%s, %s)"
    val = ("value1", "value2")
    cursor.execute(sql_insert, val)
    conn.commit()
    
    # Display data
    sql_select = "SELECT * FROM table_name"
    cursor.execute(sql_select)
    rows = cursor.fetchall()
    for row in rows:
        print(row)
    
    # Update data
    sql_update = "UPDATE table_name SET column1 = %s WHERE column2 = %s"
    val = ("new_value1", "value2")
    cursor.execute(sql_update, val)
    conn.commit()
    
    # Delete data
    sql_delete = "DELETE FROM table_name WHERE column2 = %s"
    val = ("value2",)
    cursor.execute(sql_delete, val)
    conn.commit()
    
    # Close the cursor and connection
    cursor.close()
    conn.close()
    
    





    Disclaimer

     

    All tutorials are for informational and educational purposes only and have been made using our own routers, servers, websites and other vulnerable free resources. we do not contain any illegal activity. We believe that ethical hacking, information security and cyber security should be familiar subjects to anyone using digital information and computers. Hacking Truth is against misuse of the information and we strongly suggest against it. Please regard the word hacking as ethical hacking or penetration testing every time this word is used. We do not promote, encourage, support or excite any illegal activity or hacking.

     


  • WHAT WE DO

    We've been developing corporate tailored services for clients for 30 years.

    CONTACT US

    For enquiries you can contact us in several different ways. Contact details are below.

    Hacking Truth.in

    • Street :Road Street 00
    • Person :Person
    • Phone :+045 123 755 755
    • Country :POLAND
    • Email :contact@heaven.com

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.

    Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation.