#importing modules
import math
from __future__ import division
#Variable declaration
numbers1=[5/6,3/4,5/8,6/7];
numbers2=[1/2,3/5,3/10,21/50];
numbers3=[7/12,5/16,17/36,1/3];
numbers4=[3/5,5/7,13/16,97/104];
numbers5=[2/91,5/177,22/1091,13/558];
#Calculation
a1=sorted(numbers1,reverse=True); #descending order for 1st case
a2=sorted(numbers2,reverse=True); #descending order for 2nd case
a3=sorted(numbers3,reverse=True); #descending order for 3rd case
a4=sorted(numbers4,reverse=True); #descending order for 4th case
a5=sorted(numbers5,reverse=True); #descending order for 5th case
#Result
print "the descending order for 1st case is",a1
print "the descending order for 2nd case is",a2
print "the descending order for 3rd case is",a3
print "the descending order for 4th case is",a4
print "the descending order for 5th case is",a5
#importing modules
import math
from __future__ import division
#Variable declaration
p1=5/12; #part
p2=3+(3/4); #part
a=100; #amount(Rs)
#Calculation
x=p2*a/p1; #required amount(Rs)
#Result
print "required amount is",x,"Rs"
#importing modules
import math
from __future__ import division
#Variable declaration
n=5*12; #number of bananas
fp=6; #fraction part
#Calculation
rf=fp/n; #required fraction
#Result
print "required fraction is",rf
#importing modules
import math
from __future__ import division
#Variable declaration
n=40; #number of students
np=7/10; #number of students present
#Calculation
na=(1-np)*n; #number of absentees
#Result
print "number of absentees is",na
#importing modules
import math
from __future__ import division
#Variable declaration
ps=2/7; #part of savings
al=1000; #amount left(Rs)
#Calculation
s=al/(1-ps); #savings(Rs)
#Result
print "savings is",s,"Rs"
#importing modules
import math
from __future__ import division
#Variable declaration
abyb=3/8;
xbyy=4/5;
pl=40; #pages left
#Calculation
p=pl/((1-abyb)*(1-xbyy)); #total number of pages
#Result
print "total number of pages is",p
#importing modules
import math
from __future__ import division
#Variable declaration
abyb=2/5;
xbyy=3/10;
mbyn=1/8;
ba=1400; #balance amount(Rs)
#Calculation
ts=ba/(1-(abyb+xbyy+mbyn)); #total salary(Rs)
#Result
print "total salary is",ts,"Rs"
#importing modules
import math
from __future__ import division
#Variable declaration
abyb=1/3;
xbyy=1/4;
mbyn=1/5;
ba=1760; #balance amount(Rs)
#Calculation
ts=ba/((1-abyb)*(1-xbyy)*(1-mbyn)); #total salary(Rs)
#Result
print "total salary is",ts,"Rs"
#importing modules
import math
from __future__ import division
#Variable declaration
abyb=1/3;
xbyy=1/4;
mbyn=1/5;
ba=1760; #balance amount(Rs)
#Calculation
ts=ba/((1-abyb)*(1-(xbyy+mbyn))); #total salary(Rs)
#Result
print "total salary is",ts,"Rs"
#importing modules
import math
from __future__ import division
#Variable declaration
L=250; #length in mud(Rs)
p=(4/7)-(1/3); #part in mud
#Calculation
Tl=L/p; #total length of pole(cm)
#Result
print "total length of pole is",Tl,"cm"
#importing modules
import math
from __future__ import division
#Variable declaration
dt=60; #distance travelled(km)
dp=5/8; #part travelled
#Calculation
x=dt*(1-dp)/dp; #journey still left(km)
#Result
print "journey still left is",x,"km"
#importing modules
import math
from __future__ import division
#Variable declaration
a=0.685;
b=325;
c=300;
#Calculation
x=c-(a*b); #amount to be added
#Result
print "amount to be added is",x
#importing modules
import math
from __future__ import division
#Variable declaration
abyb=0.15;
xbyy=0.65;
l=20; #length of pole(m)
#Calculation
L=l*(1-(abyb+xbyy)); #length above water(m)
#Result
print "length above water is",L,"m"
#importing modules
import math
from __future__ import division
#Variable declaration
abyb=0.375;
xbyy=0.4;
ba=3375; #balance amount(Rs)
#Calculation
ts=ba/(1-(abyb+xbyy)); #total salary(Rs)
ws=abyb*ts; #wife's share of money(Rs)
#Result
print "wife's share of money is",ws,"Rs"
#importing modules
import math
from __future__ import division
from fractions import Fraction
#Variable declaration
#a=1/3
a1=1;
a2=3;
#b=4/5
b1=4;
b2=5;
x1=2;
x2=1;
#y=7/2
y1=7;
y2=2;
#Calculation
f1=(a1+b1)/(a2+b2); #fraction between 1/3 and 4/5
f2=(x1+y1)/(x2+y2); #fraction between 2 and 7/2
#Result
print "fraction between 1/3 and 4/5 is",Fraction(f1)
print "fraction between 2 and 7/2 is",f2
#importing modules
import math
from __future__ import division
from fractions import Fraction
#Variable declaration
#a=1/3
a1=1;
a2=3;
#b=4/5
b1=4;
b2=5;
#Calculation
f11=a1+b1; #numerator of 1st fraction
f12=a2+b2; #denominator of 1st fraction
f1=f11/f12; #1st fraction
f21=a1+f11; #numerator of 2nd fraction
f22=a2+f12; #denominator of 2nd fraction
f2=f21/f22; #2nd fraction
f31=f11+b1; #numerator of 3rd fraction
f32=f12+b2; #denominator of 3rd fraction
f3=f31/f32; #3rd fraction
#Result
print "the three fractions are",f2,Fraction(f1),f3
#importing modules
import math
from __future__ import division
#Variable declaration
a=22/63;
b=4/11;
c=15/46;
d=33/98;
e=1/3;
#Calculation
if(a<e):
print "22/63 is lesser than 1/3"
if(b<e):
print "4/11 is lesser than 1/3"
if(c<e):
print "15/46 is lesser than 1/3"
if(d<e):
print "33/98 is lesser than 1/3"