Skip to content

777abhi/pytestFixtures

Repository files navigation

Python Data Types

  1. Integer (int):

    • Represents whole numbers (positive, negative, or zero).
    • Example:
      age = 25
      print("My age is", age)
  2. Float (float):

    • Represents decimal numbers.
    • Example:
      pi = 3.14
      print("The value of pi is approximately", pi)
  3. String (str):

    • Represents a sequence of characters (text).
    • Example:
      name = "Alice"
      print("Hello,", name)
  4. Boolean (bool):

    • Represents truth values (True or False).
    • Example:
      is_raining = True
      print("Is it raining?", is_raining)
  5. List:

    • Represents an ordered collection of items (mutable).
    • Example:
      fruits = ["apple", "banana", "cherry"]
      print("My favorite fruits:", fruits)
  6. Tuple:

    • Similar to a list but immutable (cannot be modified after creation).
    • Example:
      coordinates = (10, 20)
      print("Coordinates:", coordinates)
  7. Dictionary (dict):

    • Represents key-value pairs (associative array).
    • Example:
      person = {"name": "Bob", "age": 30, "city": "New York"}
      print("Person details:", person)
  8. Set:

    • Represents an unordered collection of unique elements.
    • Example:
      colors = {"red", "green", "blue"}
      print("Available colors:", colors)
  9. NoneType (None):

    • Represents the absence of a value.
    • Example:
      result = None
      print("Result:", result)

These examples demonstrate the basic data types in Python. Feel free to experiment with them and build more complex programs! 🐍✨

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages