Spark
X
Learn
Online Programs
On Campus Programs
Make Money
Masterclass
Free Resources
Alumni
Blog
Hub
PYTHON Compiler
Run Code
Run
Languages
PYTHON
JAVA
JAVASCRIPT
CPP
C
HTML
CSS
SQL
Editor
Output
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
def calculate_roi(investment, return_val): profit = return_val - investment roi = (profit / investment) * 100 return roi print(f"ROI: {calculate_roi(1000, 1500)}%")
Execution Output
Clear
Click "Run Code" to compile and execute...