๐ Beginning Python Programming / Module: Defining Functions
Defining functions
๐ Beginning Python Programming / Defining Functions / Defining functions
def percent(x, y=100): return x / y * 100 print( percent(3,10)) # 30.0 print( percent(1,3)) # 33.3333333333 print( round(percent(1,3), 2)) # 33.33 print( percent(y=10,x=2)) # 20.0 print( percent(30)) #30.0