in Python Write a code fragment that prints true if the double variables x and y are both strictly between 0 and 1and false otherwise.
Answer
Here is your answer for above probelm, if you have any doubt please comment, i am here to help you.
here is python script for above problem.
sample.py
x=0.0001 #you can give your own value to test the condition.
y=0.001
#here is the condition described in problem, we can use and operator to perform this.
#here the x and y value should in between 0 and 1, then it will be true, else false
if x>0 and x<1 and y>0 and y<1:
print("true")
else:
print("false")
output
any doubt ,please comment.,
Thanks in advance
Get Answers For Free
Most questions answered within 1 hours.