Python extern in an iframe
▸ Turtle Editor
Python Online
Schreibe (oder kopiere) in den obigen Editor
a = 5
b = 6
if a < b:
print("a ist tatsächlich kleiner als b")
elif a > b:
print(b/a)
else:
print(round(a/b,2))
▸ Hilfe
Python on a Server
- first: You have to enable shell_exec() from your server
- second: Write the following Script in a .py-file within a folder named py
a=47.541379 b=175.457931 if a > b: print(round(a/b,3)) else: print(round(b/a,3))
- third: Write the following Script in a .php-file
<?php
echo shell_exec("python py/index.py");
?>
- Last: The Result is: 3.691
Beispiel 2:
a=3 b=4 c=5 if a > b: print(a/b) elif a < b: print(round(a*b*17.865/c,2)) elif b < c: print(round(a+b+c/17.75,2)) else: print(round(b/a*c,1))Das Resultat lautet: 42.88 ▸ up