+ 2
Fraction input?
I have created a code to solve sequence and series like questions. But I needed to have fraction as input . How to solve this problem? Reply if anybody know about this issue.
2 Answers
+ 2
assuming it is Python, you can use the fraction module
https://docs.python.org/3/library/fractions.html
from fractions import Fraction
#sample input : 1/2
myfraction = Fraction(input())
print(myfraction)
print(myfraction*2)
+ 4
tag the relevant programming language.
give an example.
you can take multiple numbers as input.