Misty Lessons
  • Misty Lessons
    • 📖Welcome to Misty Lessons
    • 📚Get to know your Misty
    • 📲Connect to Misty
    • 👩‍💻Misty Studio
    • 🖥️Desktop Environment
    • ⬆️Update your Misty
    • 👥Projects
  • Blockly
    • 🧩Blockly Lessons
      • 🤸Lesson 1: Movement
      • 🎶Lesson 2: Voice and Sound
      • 🎭Lesson 3: Expressions
      • 🎥Lesson 4: Robot Cinema
      • 🛠️Lesson 5: Events
      • ☺️Lesson 6: Face recognition
      • 🔢Lesson 7: Variables and Functions
      • 💬Lesson 8: NLP
    • 🏫Blockly projects
  • Blockly Elements
    • ⚛️Misty Blocks
      • Movement
      • Speech
      • Audio
      • Vision
      • Events
      • Miscellaneous
      • NLP
      • System
    • 🔁Basic Blocks
      • Logic
      • Loops
      • Math
      • Text
      • Lists
    • 🅰️Advanced Blocks
      • Variables
      • Functions
  • Python
    • 🐍Python Lessons
      • 🦿Lesson 1: Loco-motion
      • 🤖Lesson 2 : Build a character
      • 🧠Lesson 3: Create memories
      • ⚒️Lesson 4: Event skills
      • 👀Lesson 5: Expand awareness
      • 🔗Lesson 6: Compact code
      • 🗣️Lesson 7: Start a conversation
  • Python Elements
    • 🐸Misty Python API
      • Motion and Mobility
      • Display and LED
      • Record Assets
      • Change/Remove Assets
      • Stream Assets
      • Get Assets
      • Events
      • Sensor Events
      • Speech and NLP
      • Arduino Backpack
      • System
      • Slam
    • 📗Python Definitions
  • Python Projects
    • 🔮MistyGPT
    • 🚨Misty Intruder Alert
    • 📺Conference Assistant
    • 🏷️QR code detector
    • 🕵️‍♂️Misty follow human
    • 👋Misty wave back
    • 🖲️Misty OA
    • 🌐Get weather
    • 🚚Misty Delivery
    • 🫂Motivational Misty
    • 🖼️Misty Museum Guide
    • 🎃Who for Halloween
  • ARDUINO
    • ♾️Arduino Backpack
    • 🦎Arduino
    • 🔧Arduino Lessons
      • 🔌Arduino to Misty
      • ➕Misty to Arduino
  • ARDUINO PROJECTS
    • 🛠️Misty Tracker
    • 🦾Misty Arm
  • Community Projects
    • 🌤️Misty weather forecaster
  • HARDWARE EXTENSION
    • ⚙️Arduino breadboard support
    • 🦾Misty arm
    • 🥤Tin holder
  • Resource Database
    • 📁Image files
    • 📁Audio files
    • 📁Languages
    • 📁Known objects
    • 📁NLP Actions
    • 📁Action Commands
    • 📁ChatGPT PDF files
    • 📁AR Tag Dictionary
    • ⚙️Technical Specifications
Powered by GitBook
On this page
  • Value Types (Data Types)
  • Keywords
  1. Python Elements

Python Definitions

Python, being a dynamically typed language, offers a variety of value types (data types) and keywords that are integral to its programming structure. Here's a list of some common value types and keywords along with their definitions:

Value Types (Data Types)

  1. int: Represents integer values. Example: 5, -3.

  2. float: Represents floating-point numbers (decimals). Example: 3.14, -0.001.

  3. str: String type for text. Example: "Hello", 'Python'.

  4. bool: Boolean type, representing True or False.

  5. list: An ordered, mutable (changeable) collection of items. Example: [1, 2, 3], ['a', 'b', 'c'].

  6. tuple: An ordered, immutable collection of items. Example: (1, 2, 3), ('a', 'b', 'c').

  7. dict: Dictionary type, an unordered collection of key-value pairs. Example: {'name': 'Alice', 'age': 25}.

  8. set: An unordered collection of unique items. Example: {1, 2, 3}.

  9. NoneType: Special type representing the absence of a value or a null value. Example: None.

Keywords

  1. def: Used to define a function. Example: def my_function():.

  2. return: Used to return a value from a function.

  3. class: Used to define a class.

  4. import, from: Used to import modules or specific functions, classes, etc., from modules.

  5. as: Used in import statements to give an imported module a different alias, or with try...except blocks to rename exceptions.

  6. if, elif, else: Conditional statements.

  7. for, while: Loop control statements.

  8. break: Exits a loop.

  9. continue: Skips the current iteration in a loop.

  10. try, except, finally, raise: Exception handling keywords.

  11. with: Used for exception handling in resource management (like file reading/writing).

  12. global: Declares a variable as global.

  13. nonlocal: Declares a variable as non-local (useful in nested functions).

  14. lambda: Used to create an anonymous function.

  15. yield: Used in a function like return, but for generator functions.

  16. del: Deletes an object.

  17. pass: A null statement, a placeholder for future code.

  18. assert: Used for debugging purposes to check conditions that should always be True.

  19. in, not in: Membership operators.

  20. is, is not: Identity operators.

Last updated 7 months ago

📗
Page cover image