hello in my pyton home work i was asked to write a function Which receives a real number (type float) called num and returns the number hop
Before and after a decimal point. for exemple 56.43 will retuen 43.56
the code I wrote is:
can u please define my problem?       Â
Before and after a decimal point. for exemple 56.43 will retuen 43.56
the code I wrote is:
def parts(num): Â Â Â a=str(num) Â Â Â for i in range(len(a)): Â Â Â Â Â Â Â if a[i]=='.': Â Â Â Â Â Â Â Â Â Â Â return float(a[i+1:]+'.'+a[:i]) parts(343.4)and it didnt gave me back anything
can u please define my problem?       Â
Moderator zivoni: please use code tags for future posts