def tyrecalc(ts1,ts2): ts1wid = ts1[0:3] ts1prof = ts1 [3:5] ts1dia = ts1[5:7] ts1wid = float(ts1wid) ts1prof = float(ts1prof) ts1dia = float(ts1dia) ts1x = ts1wid / 100 * ts1prof ts1x = ts1x / 25.4 * 2 + ts1dia ts2wid = ts2[0:3] ts2prof = ts2 [3:5] ts2dia = ts2[5:7] ts2wid = float(ts2wid) ts2prof = float(ts2prof) ts2dia = float(ts2dia) ts2x = ts2wid / 100 * ts2prof ts2x = ts2x / 25.4 * 2 + ts2dia tsdif = ts1x - ts2x tsdif = tsdif / ts1x * 100 print(ts1x) print(ts2x) print(tsdif) if abs(tsdif) < abs(2.5): print ("GOOD FITMENT") else: print("BAD FITMENT") tyrecalc("2055516","2154517")
Run
Reset
Share
Import
Link
Embed
Language▼
English
中文
Python Fiddle
Python Cloud IDE
Follow @python_fiddle
Browser Version Not Supported
Due to Python Fiddle's reliance on advanced JavaScript techniques, older browsers might have problems running it correctly. Please download the latest version of your favourite browser.
Chrome 10+
Firefox 4+
Safari 5+
IE 10+
Let me try anyway!
url:
Go
Python Snippet
Stackoverflow Question