0
This is a python gold related problem and please find bug in this problem.
purity = float(input()) #your code goes here x = 91.7 y = 99.9 if purity >= x and purity <= y: print("Accepted") else: print("")
11 ответов
+ 3
I was trying to say you to do it like this
You would understand it if you read my above comment carefully
purity = float(input())
if purity >= 91.7:
print("Accepted")
+ 2
Here I fixed it
purity = float(input())
#your code goes here
x = 91.7
y = 99.9
if purity >= x or purity >= y:#here
print("Accepted")
else:
print ("")
I think you misunderstood to the problem.plz read the description again, it will be clear
actually , no need to use else statement.
but using in that way doesn't effect to problem
+ 2
It's simple, just delete it.
purity = float(input())
#your code goes here
x = 91.7
y = 99.9
if purity >= x or purity >= y:
print("Accepted")
+ 2
#Myo Thuzar, great job. You're right. It helped me a lot. Thank you.
+ 1
Hi. I have tried without using else statement. Please help me with this.
+ 1
Sorry #Python Learner. Now I understood what you were trying to say.
+ 1
purity = float(input())
x= 91.7
y = 99.9
s ="Accepted" if x <= purity <= y else ""
print(s)
0
Hi Amol!
They are saying that above 91.7% is a good level of purity. It means all values that greater than or equal to 91.7 are acceptable(100 too). So, you can use only this value to check the purity.
Always remember that you have to use and operator to check inside the range
For example,
x< y < z it's similar to y > x and y < z
Similarly, use or for outside the range.
So your code needs to be like this
purity = float(input())
#your code goes here
x = 91.7
y = 99.9
if purity >= x or purity >= y:
print("Accepted")
else:
print("")
0
In this problem, the result section test code #5 is not running. What is the problem?
0
if purity > 91.7:
print("Accepted)
this also works because 99.9 is greater than 91.7
- 1
#Python learner, first you try your code, please. Then answer me.