Question: In a new, empty . py fIle, import the Fraction module ( from fractions import Fraction ) and then create a Fraction object equal to

In a new, empty .py fIle, import the Fraction module (from fractions import Fraction) and then create a Fraction object equal to one-half (i.e.(1)/(2)). Then, using a loop add to this fraction the next 10 values in the sequence 1/4,1/8,1/16 etc. Print the new value of the fraction after the addition at each step of the loop. If you kept on going, would the value of your fraction ever reach 1? Try changing the loop to a bigger value to find out!

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!