can someone tell what's wrong with this code? I can't figure out what the error is | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

can someone tell what's wrong with this code? I can't figure out what the error is

Now that we know how to combine multiple conditions, let’s improve our gold purity checker program and output the corresponding purity level in Karats! Here is the purity chart we’ll be using: 24K – 99.9% 22K – 91.7% 20K – 83.3% 18K – 75.0% If the percentage is between 75 and 83.3, the gold is considered to be 18K. If it's between 83.3 and 91.7 - then it’s 20K, and so on. Given the percentage as input, output the corresponding Karat value, including the letter K. Sample Input: 92.4 Sample Output: 22K https://code.sololearn.com/cmNlhg9H5l4w/?ref=app

19th Oct 2021, 2:04 AM
Kelbis Hernandez
Kelbis Hernandez - avatar
4 Answers
+ 3
Hi Kelbis! You have a typo in your 3rd if statement. It needs to be purity < 99.9
19th Oct 2021, 2:51 AM
Python Learner
Python Learner - avatar
+ 1
Kelbis Hernandez 22k test 99.99:
19th Oct 2021, 2:50 AM
Paul K Sadler
Paul K Sadler - avatar
19th Oct 2021, 2:57 AM
Kelbis Hernandez
Kelbis Hernandez - avatar
+ 1
Tag the programming language you're asking doubt in, not the lesson number. All the best =)
19th Oct 2021, 3:03 AM
Rishi
Rishi - avatar