Ejemplo: Python ejecutar cadena
a = """
A = 5
if A > 0 :
print("A Is Positive")
elif A == 0 :
print("A Is Equal To 0")
else :
print("A Is Negative")
"""
exec(a)
>>> A Is Positive
#you can also use eval(string) for asyncio
¡Haz clic para puntuar esta entrada!
(Votos: 0 Promedio: 0)