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("")

6th Oct 2021, 4:55 AM
Amol
Amol - avatar
11 Antworten
+ 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")
6th Oct 2021, 6:45 AM
Python Learner
Python Learner - avatar
+ 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
6th Oct 2021, 5:20 AM
Myo Thuzar
Myo Thuzar - avatar
+ 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")
6th Oct 2021, 5:30 AM
Myo Thuzar
Myo Thuzar - avatar
+ 2
#Myo Thuzar, great job. You're right. It helped me a lot. Thank you.
6th Oct 2021, 5:38 AM
Amol
Amol - avatar
+ 1
Hi. I have tried without using else statement. Please help me with this.
6th Oct 2021, 5:26 AM
Amol
Amol - avatar
+ 1
Sorry #Python Learner. Now I understood what you were trying to say.
6th Oct 2021, 8:23 AM
Amol
Amol - avatar
+ 1
purity = float(input()) x= 91.7 y = 99.9 s ="Accepted" if x <= purity <= y else "" print(s)
7th Oct 2021, 12:18 PM
Ario
Ario - avatar
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("")
6th Oct 2021, 5:18 AM
Python Learner
Python Learner - avatar
0
In this problem, the result section test code #5 is not running. What is the problem?
6th Oct 2021, 5:31 AM
Amol
Amol - avatar
0
if purity > 91.7: print("Accepted) this also works because 99.9 is greater than 91.7
8th Oct 2021, 4:27 AM
enzore
enzore - avatar
- 1
#Python learner, first you try your code, please. Then answer me.
6th Oct 2021, 5:33 AM
Amol
Amol - avatar