https://linen.dev logo
Join Slack
Powered by
# main
  • Basic Excel Skills
    i

    icy-processor-22774

    03/05/2024, 6:40 AM
    Basic Excel skills encompass a range of fundamental techniques that allow users to effectively navigate and manipulate data within Microsoft Excel, a widely used spreadsheet application. Read More -

    https://www.youtube.com/watch?v=hrgbF9jhsc0▾

  • Contact Book Project in Python for Beginners | Mini Project on Contact Book
    w

    wooden-helicopter-13221

    03/12/2024, 12:04 PM
    Certainly! Creating a basic contact book project in Python using dictionaries is a great way for beginners to practice their skills. Below is a simple implementation:
    python Copy code
    def add_contact(contacts, name, number):
        if name in contacts:
            print("Contact already exists!")
        else:
            contacts[name] = number
            print("Contact added successfully!")
    
    
    def remove_contact(contacts, name):
        if name in contacts:
            del contacts[name]
            print("Contact removed successfully!")
        else:
            print("Contact not found!")
    
    
    def display_contacts(contacts):
        if contacts:
            print("Contacts:")
            for name, number in contacts.items():
                print(f"{name}: {number}")
        else:
            print("No contacts to display.")
    
    
    def main():
        contacts = {}
    
        while True:
            print("\nContact Book")
            print("1. Add Contact")
            print("2. Remove Contact")
            print("3. Display Contacts")
            print("4. Quit")
    
            choice = input("Enter your choice: ")
    
            if choice == "1":
                name = input("Enter contact name: ")
                number = input("Enter contact number: ")
                add_contact(contacts, name, number)
            elif choice == "2":
                name = input("Enter contact name to remove: ")
                remove_contact(contacts, name)
            elif choice == "3":
                display_contacts(contacts)
            elif choice == "4":
                print("Exiting...")
                break
            else:
                print("Invalid choice! Please enter a valid option.")
    
    
    if __name__ == "__main__":
        main()
    This code provides a simple command-line interface for managing contacts. You can add, remove, and display contacts using this program. It stores contacts in a dictionary where the keys are the names of the contacts and the values are their corresponding phone numbers. To run this program, simply copy the code into a Python file (e.g.,
    contact_book.py
    ) and execute it with a Python interpreter (
    python contact_book.py
    ). Watch Now:-

    https://www.youtube.com/watch?v=4sEfkbqDWJM&t=68s▾