0

Why is my code not correct

You’re making a gold purity checker, that should accept only 22K or 24K gold. Only the good stuff! 22K gold has 91.7% or more gold in it, while 24K corresponds to 99.9% and above purity. Given the % of gold purity as input, you should output "Accepted" only if it corresponds to 22 or 24K. Sample Input: 93.4 Sample Output: Accepted My answer Purity=float(input()) If purity>=91.7: Print("Accepted") If purity>=99.9: Print("Accepted")

5th Oct 2021, 10:13 AM
Natty Misgun
3 Respuestas
0
Natty Misgun Python is case sensitive language. So hope there capital P , in print and purity are auto correction... Read again problem, if input is 99.9 then your both if conditions are true so it prints Accepted twice. But need to print only once...
5th Oct 2021, 10:37 AM
Jayakrishna 🇮🇳
+ 1
#try this purity = float(input()) if purity >= 91.7: print("Accepted")
5th Oct 2021, 10:32 AM
Simba
Simba - avatar
0
Thanks for answering 🙂
5th Oct 2021, 1:31 PM
Natty Misgun