Object: Methods and properties

UpComing SoftWare Training Demos

πŸš€ *Gen AI EngineerΒ Telugu (Production Focused)*
πŸ—“οΈ *Date:* 30th Sept 2026, 07:00AM IST
πŸ“ *Register Now!:*
https://www.vlrt.in/gr
πŸ‘₯ *Join WA Community:*
https://www.vlrt.in/gw
πŸ’‘*Course Content:*
https://www.vlrt.in/ai
▢️ *Demo Videos:*
https://www.vlrt.in/gv

πŸš€ *Service now Admin/ Development (ITSM)FREE Demo in Telugu*
πŸ—“οΈ *Date:* 30th Sept 2026, 08:00AM IST
πŸ“ *Register Now!:*
https://www.vlrt.in/7r
πŸ‘₯ *Join WA Community:*
https://www.vlrt.in/7w
πŸ’‘*Course Content:*
https://www.vlrt.in/7c
▢️ *Demo Videos:*
https://www.vlrt.in/7v

πŸš€ *Vulnerability Management Training Demo*
πŸ—“οΈ *Date:* 30th Sept 2026, 09:00 AM IST
πŸ“*Register Now!:*
https://www.vlrt.in/vr
πŸ‘₯ *Join Community:*
https://www.vlrt.in/cw
πŸ’‘ *Course Content:*
https://www.vlrt.in/vc
▢️ *Demo Videos:*
https://www.vlrt.in/Vm

πŸš— Car Properties βš™οΈ Car Methods

πŸš— Car Properties

Properties are the nouns that describe a car. They are the characteristics or attributes that define a specific car’s state. Think of them as the data associated with a car object.

Examples:

  • 🎨 color: The color of the car (e.g., red, blue, black).
  • 🏭 make: The brand of the car (e.g., Toyota, Ford, Honda).
  • 🏷️ model: The specific model of the car (e.g., Corolla, Mustang, Civic).
  • πŸ“… year: The year the car was manufactured (e.g., 2025).
  • ⚑ speed: The current speed of the car (e.g., 0 mph, 60 mph).
  • πŸ”‘ is_engine_on: A state that tells you if the engine is running (True or False).
  • β›½ fuel_level: The amount of gas in the tank (e.g., 75%).

βš™οΈ Car Methods

Methods are the verbs that describe what a car can do. They are the actions or functions that operate on the car’s properties. Methods often change the state of the car.

Examples:

  • ▢️ start_engine(): This method changes the is_engine_on property from False to True.
  • πŸš€ accelerate(): This method increases the car’s speed property.
  • πŸ›‘ brake(): This method decreases the car’s speed property.
  • ⏹️ turn_off_engine(): This method changes the is_engine_on property from True to False.
  • ΰΉ€ΰΈ•ΰΈ΄ΰΈ‘ refuel(amount): This method takes an amount as input and increases the fuel_level property.
  • πŸ”Š honk_horn(): This method performs an action (makes a sound).

Bank Account Properties Methods

🏦 Bank Account Properties

Properties are the nouns that describe a bank account. They represent the data and characteristics that make each account unique. Think of them as the information you see on your bank statement.

Examples:

  • πŸ”’ account_number: A unique number assigned to the account. This property is crucial because it identifies the specific account.
  • πŸ‘€ account_holder_name: The name of the person or business that owns the account.
  • πŸ’° balance: The current amount of money in the account. This is the most important property as it changes with every transaction.
  • πŸ’³ account_type: The kind of account it is, such as savings, checking, or current.
  • πŸ’² currency: The type of currency the account holds (e.g., USD, EUR, INR).

πŸ’Έ Bank Account Methods

Methods are the verbs that describe what you can do with a bank account. They are the actions or functions that allow you to interact with the account’s properties, particularly its balance.

Examples:

  • πŸ“₯ deposit(amount): This method adds money to the account. When you deposit money, the balance property increases.
  • πŸ“€ withdraw(amount): This method removes money from the account. It also checks if there is enough money in the balance before allowing the withdrawal.
  • ℹ️ get_balance(): This method returns the current value of the balance property without allowing you to change it directly. This is a common way to see how much money is in the account.
  • ➑️ transfer(target_account, amount): This method is a bit more complex. It first calls the withdraw() method from the current account and then calls the deposit() method on the target_account.
  • πŸ“œ check_transactions(): This method provides a history of all deposits and withdrawals that have occurred on the account.

πŸ” Food Order Properties And Methods

πŸ” Food Order Properties

Properties are the nouns that describe a food order. They represent the data and characteristics that make each order unique. Think of them as the details on a receipt.

Examples:

  • πŸ“ order_id: A unique number assigned to the order. This is like a ticket number.
  • πŸ§‘β€πŸ³ customer_name: The name of the person who placed the order.
  • πŸ“‹ items: A list of the food items included in the order (e.g., ['burger', 'fries', 'soda']).
  • πŸ’² total_price: The total cost of the order, calculated from the items.
  • πŸ“ delivery_address: The location where the food needs to be delivered.
  • ⏱️ status: The current state of the order, such as pending, in_progress, delivered, or cancelled.

πŸ“² Food Order Methods

Methods are the verbs that describe what can be done with a food order. They are the actions or functions that allow the system to manage the order’s properties.

Examples:

  • βž• add_item(item_name, price): This method adds a new food item to the items list and updates the total_price property.
  • βž– remove_item(item_name, price): This method removes an item from the items list and reduces the total_price.
  • βœ… confirm_order(): This method changes the status of the order from pending to in_progress and sends a confirmation to the customer.
  • 🚚 dispatch_delivery(): This method changes the status to dispatched and assigns a delivery driver.
  • ❌ cancel_order(): This method changes the status to cancelled and might trigger a refund process.

πŸ“š Book Properties & Methods

A book can be an object with properties that describe it and methods that allow you to interact with it.


πŸ“– Book Properties

Properties are the nouns that describe a book’s characteristics.

  • title: The name of the book (e.g., 'The Hitchhiker's Guide to the Galaxy').
  • author: The person who wrote the book (e.g., 'Douglas Adams').
  • page_count: The total number of pages in the book (e.g., 42).
  • current_page: The page number the reader is currently on.
  • is_open: A state that tells you if the book is currently open or closed (True or False).

πŸ“š Book Methods

Methods are the verbs that describe what a book can do or what you can do with it.

  • open(): Changes the is_open property to True.
  • close(): Changes the is_open property to False.
  • turn_page(): Increases the current_page property by one.
  • read(pages): Advances the current_page by a specified number of pages.
  • get_progress(): Calculates and returns the percentage of the book you have read.

πŸ’» Laptop Properties & Methods

A laptop can also be an object with its own unique properties and methods.


πŸ’» Laptop Properties

Properties are the nouns that describe a laptop’s state and hardware.

  • brand: The manufacturer of the laptop (e.g., 'Dell', 'Apple').
  • model: The specific model name (e.g., 'XPS 15', 'MacBook Air').
  • battery_level: The current battery charge percentage (e.g., 85%).
  • is_on: A state that tells you if the laptop is powered on (True or False).
  • screen_brightness: The current brightness level of the display.

πŸ–₯️ Laptop Methods

Methods are the verbs that describe what a laptop can do or how a user can control it.

  • power_on(): Changes the is_on property to True and performs a startup routine.
  • shut_down(): Changes the is_on property to False.
  • increase_brightness(): Increases the screen_brightness property.
  • run_program(program_name): Launches a specific application.
  • charge(): Increases the battery_level property over time.

Similar Posts

  • Linear vs. Scalar,Homogeneous vs. HeterogeneousΒ 

    Linear vs. Scalar Data Types in Python In programming, data types can be categorized based on how they store and organize data. Two important classifications are scalar (atomic) types and linear (compound) types. 1. Scalar (Atomic) Data Types 2. Linear (Compound/Sequential) Data Types Key Differences Between Scalar and Linear Data Types Feature Scalar (Atomic) Linear (Compound) Stores Single…

  • Negative lookbehind assertion

    A negative lookbehind assertion in Python’s re module is a zero-width assertion that checks if a pattern is not present immediately before the current position. It is written as (?<!…). It’s the opposite of a positive lookbehind and allows you to exclude matches based on what precedes them. Similar to the positive lookbehind, the pattern…

  • While loop

    A while loop in Python is used to repeatedly execute a block of code as long as a given condition remains True. It is particularly useful when you don’t know beforehand how many times the loop needs to run. Before every iteration, Python evaluates the condition. If it evaluates to True, the code inside the…

  • Predefined Character Classes

    Predefined Character Classes Pattern Description Equivalent . Matches any character except newline \d Matches any digit [0-9] \D Matches any non-digit [^0-9] \w Matches any word character [a-zA-Z0-9_] \W Matches any non-word character [^a-zA-Z0-9_] \s Matches any whitespace character [ \t\n\r\f\v] \S Matches any non-whitespace character [^ \t\n\r\f\v] 1. Literal Character a Matches: The exact character…

  • Positional-Only Arguments in Python

    Positional-Only Arguments in Python Positional-only arguments are function parameters that must be passed by position (order) and cannot be passed by keyword name. Syntax Use the / symbol in the function definition to indicate that all parameters before it are positional-only: python def function_name(param1, param2, /, param3, param4): # function body Simple Examples Example 1: Basic Positional-Only Arguments python def calculate_area(length,…

  • Quantifiers (Repetition)

    Quantifiers (Repetition) in Python Regular Expressions – Detailed Explanation Basic Quantifiers 1. * – 0 or more occurrences (Greedy) Description: Matches the preceding element zero or more times Example 1: Match zero or more digits python import re text = “123 4567 89″ result = re.findall(r’\d*’, text) print(result) # [‘123’, ”, ‘4567’, ”, ’89’, ”] # Matches…

Leave a Reply

Your email address will not be published. Required fields are marked *