Andre Menezes 0 Posted May 31, 2020 Report Share Posted May 31, 2020 (edited) Como posso transformar um numero decimal em fracionário? -0,6 em -3/5 por exemplo. Edited May 31, 2020 by Andre Menezes Quote Link to post Share on other sites
0 SilvioHC 0 Posted June 26, 2020 Report Share Posted June 26, 2020 ESSA FOI A FORMA QUE ACHEI, ELA MOSTRA MAIS DE UMA OPÇÃO! valor = -0.6 for i in range(-10,10): for j in range(-10,10): try: if i/j == valor: print(f'{i}/{j}') except:None Quote Link to post Share on other sites
Question
Andre Menezes 0
Como posso transformar um numero decimal em fracionário?
-0,6 em -3/5 por exemplo.
Edited by Andre MenezesLink to post
Share on other sites
1 answer to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.