🍰
Grasshopper ES por BetweenRealities
  • Using and Generating Documentation
    • GitHub
    • Discord
      • Speckle Webhooks
    • Speckle Client
  • Potencial technological implementations
  • 🧞Compute
    • Introducción a Grasshopper
      • Customizar Entorno
        • VSCode
      • Rhinoceros 3d
      • Hops
      • Galapagos
    • Modelos Informados
      • Comportamiento Estructural
        • Automatizar cálculo Python
      • OOP
      • Rhino Inside Revit
        • Revit
          • Modelado 3d en Revit
          • Certificación profesional Revit
      • Energía
    • Procesos Urbanos
      • Automatizar Qgis
      • Librerías Python
      • Librerías Grasshopper
      • Stable Diffusion
    • Programación
      • RhinoPython
        • Anatomía del script
        • Python básico
        • Tuples, listas y diccionarios
        • Operadores y funciones
        • Ejecución condicional
        • Geometría
        • Clases
      • Multithread
  • 🪅Database
    • Lenguaje Python
      • Types and operations
      • Statements and syntax
      • Function and generators
      • Modules and packages
      • Classes and OPP
      • Exception and tools
      • Advance topics
    • Análisis de la Información
      • Comparison with SQL
      • Comparison with R / R libraries
      • Pandas
    • Abrir Acceso
      • Rest API Abierta
    • Blockchain Descentralización
  • 🕸️COLLECT
    • Captura de Datos
      • Raspberry Pi
        • Encendido y apagado automático
      • Arduino
      • UAS
      • Fotogrametría
        • Crashes
    • Técnicas Machine Learning
      • Clasificación
      • Computer Vision
    • Computación en la Nube
      • Contenedores
      • Azure
      • Ubuntu Server Deploy
      • PostgreSQL Server
      • Rhino Compute Deploy
  • 🍭INTERACT
    • Introducción a Unreal Engine
      • Ejecutar Python
      • Datasmith
      • Materiales
        • Crear PBR
        • Materiales Introducción
      • Iluminación
        • Iluminación Introducción
        • Raytraced Iluminación Cinemática
      • Assets Management
    • Interacción Inmersiva
      • Blueprints
        • Blueprints estandar
        • Blueprints Introducción
        • Diseño Nivel
      • Packaging
      • Performance
    • Interfaces Bidimensionales
Con tecnología de GitBook
En esta página

¿Te fue útil?

  1. Database
  2. Lenguaje Python

Statements and syntax

Statements and syntax

  • Statements: Python hierarchy; Statements (one statement per line and indent all in a nested block); Interactive loops.

Single statement span multiple lines: enclosing in parentheses, square brackets or curly braces. Code a compound statement on a single line: only if the body consist of only non-compound statement (eg. print(a)). Type semicolon at the end of a statement: for squeeze onto a single line of code, it can lead to code that is difficult to read. What is a try statement for?: catch and recover from exceptions.

  • Assignments, expressions and prints: Assignment statements; Expression statements; Print operations.

Name ways assign 3 variable to the same value: (A=B=C=D), (A,B,C=0,0,0) or (A=0;B=0;C=0). Why might you need to care when assigning 3 variables to a mutable object?: because propagate the result if is a list or a dictionary, with number or string is irrelevant. Use print to send text to an external file: print(X, file=F).

  • If test and syntax rules: If statements; Python syntax revisited; Truth values and boolean tests; The if/else ternary expression.

Code a multi-way branch: if statement with multiple elif clauses; Dictionaries indexing if the dict contains callable functions coded with def statements or lambda expressions. Code and if/else statement: if/else, and/or. Make s single statement span many times: brackets.

  • While and for loops: While loops; Break, continue, pass and the loop else.

Differences between while and for: for iterate across items in a sequence. Difference between break and continue: break exits the loop immediately. How can you counter-based loop?: using a range function in for loops.

  • Iterations and comprehensions: List comprehension; New iteration; Other iteration.

How are for loops and iterable objects related?: next built-in function. Name 4 iteration contexts: for, map, in, sorted, sum, any, all; list, tuple, join. Best way to read line by line from a text file: next method.

  • Documentation interlude: Common coding gotchas. Docstrings, online and manual resources, PyDoc's help function.

3 Ways you can view documentation strings: help. Obtain a list of the available attributes in an object: dir(x); [a for a in dir(X) if not a.starts with('__')]. Get a list of all available modules on your computer.

AnteriorTypes and operationsSiguienteFunction and generators

Última actualización hace 2 años

¿Te fue útil?

🪅