Skip to content

Commit 94fabfd

Browse files
ratio finding with python.
1 parent 8137d97 commit 94fabfd

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

retio.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
def greatestCommonFactor(whiteC, redC):
2+
return whiteC if(redC == 0) else greatestCommonFactor(redC, whiteC % redC)
3+
4+
redCorpuscles = 5000000
5+
whiteCorpuscles = 8000
6+
7+
factor = greatestCommonFactor (whiteCorpuscles, redCorpuscles)
8+
9+
whiteRatio = int(whiteCorpuscles/factor)
10+
redRatio = int(redCorpuscles/factor)
11+
12+
print("Aspect Ratio:", whiteRatio,":",redRatio)

0 commit comments

Comments
 (0)