This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | # rpdi_step_by_step.py | |
| # Reparto proporcional (directo / inverso) por consola | |
| # Muestra paso a paso: magnitudes, suma S, k y cálculo de cada parte. | |
| from math import * | |
| DECIMALES = 6 # decimales para los cálculos intermedios | |
| TOLERANCIA = 1e-6 # tolerancia para comprobar que la suma de partes = total | |
| def pedir_entero(mensaje): | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | def resolver_proporcionalidad(): | |
| print("=== Proporcionalidad compuesta (explicada paso a paso) ===") | |
| # Número de magnitudes | |
| try: | |
| n = int(input("Cantidad de magnitudes (minimo 3): ")) | |
| except: | |
| print("Entrada no valida.") | |
| return | |
| while n < 3: | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | 0123456789012345678901234567890123456789 | |
| ---------------------------------------- | |
| from math import * | |
| # roots(a,b,c) computes the solutions of the equation a*x**2+b*x+c=0 | |
| def roots(a,b,c): | |
| delta = b*b-4*a*c | |
| if delta == 0: | |
| return -b/(2*a) | |
| elif delta > 0: | |
| x_1 = (-b-sqrt(delta))/(2*a) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | import kandinsky as kd | |
| import ion | |
| from math import pi, tan | |
| modo_calculo = "ambos" | |
| def clear(): | |
| kd.fill_rect(0, 0, 320, 240, kd.color(255, 255, 255)) | |
| def wait_key(): |