Godtone
Joined 17 December 2020
m →My Python 3 code: correction |
m →My Python 3 code: correction 2 |
||
| Line 514: | Line 514: | ||
def striv(n, d=None): | def striv(n, d=None): | ||
if d==None and type(n)==tuple and type(n[0])==int and type(n[1])==int: | if d==None and type(n)==tuple and type(n[0])==int and type(n[1])==int: | ||
if len( | if len(d)==2: | ||
return str(n[0])+'/'+str(n[1]) | return str(n[0])+'/'+str(n[1]) | ||
elif len( | elif len(d)==3 and type(n[2])==int: # (possible future expansion) | ||
return str(n[0])+'/'+str(n[1])+': '+str(n[2]) | return str(n[0])+'/'+str(n[1])+': '+str(n[2]) | ||
if type(d)==int and type(n)==tuple and type(n[0])==int and type(n[1])==int: | if type(d)==int and type(n)==tuple and type(n[0])==int and type(n[1])==int: | ||