Created
August 20, 2018 16:38
-
-
Save eloidrai/60878a444d9efb08bc97e9c255196499 to your computer and use it in GitHub Desktop.
Simplifie les fractions en fournissant la rédaction exigée par les professeurs (idéal pour gagner du temps dans les exercices-maison) !
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# coding: utf-8 | |
n = int(input("Numérateur ")) | |
d = int(input("Dénominateur ")) | |
m = max([n,d]) | |
for x in range(m,0,-1): | |
if n%x == 0 and d%x == 0 : | |
print("= (%s*%s) / (%s*%s)" %(int(n/x),int(x),int(d/x),int(x))) | |
print("= %s/%s" %(int(n/x),int(d/x))) | |
break |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment