fork download
  1. print("VAS PRIVETSTVOOET YobaLisp 0.0.2\n")
  2. print("DLYA VIHODA NABERITE \"exit\"\n\n")
  3.  
  4. import math
  5. def yoba17(massiv):
  6. massiv, matrica = tuple(map(int, massiv)), dict()
  7. n, ocherednoy = int((-1 + math.sqrt(1 + 8 * len(massiv))) / 2), 0
  8. for i in range(n):
  9. for j in range(n):
  10. if (j, i) in matrica:
  11. znachenie = matrica[(j, i)]
  12. else:
  13. znachenie = matrica[(i, j)] = massiv[ocherednoy]
  14. ocherednoy += 1
  15. print(znachenie, end="\t")
  16. print()
  17.  
  18. def yoba18(massiv):
  19. noviy_massiv = tuple(map(lambda chislo: max(chislo, -chislo), (map(int, massiv))))
  20. kolichestvo = len(tuple(filter(lambda chisla: chisla[0] != chisla[1], zip(noviy_massiv, massiv))))
  21. print(noviy_massiv)
  22. print(kolichestvo)
  23.  
  24. from functools import reduce
  25. def yoba19():
  26. print(tuple(reduce(lambda r, n: (r[0] + n, r[1] * n), range(12, 100, 3), (0, 1))))
  27.  
  28. while True:
  29. vvod = input("ALLOY ~ ")
  30. if vvod.lower() == "exit":
  31. break
  32. try:
  33. vvod = vvod.replace("(", "", 1).replace(" ", "(", 1).replace(" ", ",")
  34. if "(" not in vvod:
  35. vvod = vvod.replace(")", "()")
  36. eval(vvod)
  37. except:
  38. print("A-TYA-TYA: unknown \"{}\", but mojnazdelat'\n".format(vvod))
  39.  
Runtime error #stdin #stdout 0.02s 5852KB
stdin
(yoba19)
stdout
VAS PRIVETSTVOOET YobaLisp 0.0.2

DLYA VIHODA NABERITE "exit"


ALLOY ~ (1665, 297969682479098522486780036131650505141125120000000)
ALLOY ~