22.2 Pure Gold | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

22.2 Pure Gold

Not sure what I am doing wrong. It says invalid syntax and points to the colon? purity = float(input() if purity >=91.7 and purity <=99.9: print("Accepted")

21st May 2021, 7:23 PM
Reagan Keith
Reagan Keith - avatar
4 Answers
+ 1
you just missed the ) after the input().
21st May 2021, 7:29 PM
Dino Wun (Use the search bar plz!)
Dino Wun (Use the search bar plz!) - avatar
+ 1
often you have to search error before the line pointed by the error: here error show line 2 because expecting a closing parenthesis: the one opened by float() call...
21st May 2021, 7:33 PM
visph
visph - avatar
+ 1
All the test cases passed except #5, but its locked so i cant see it. Not sure what else is wrong
21st May 2021, 7:58 PM
Reagan Keith
Reagan Keith - avatar
- 1
the correct code covering all 5 cases: purity = float(input()) if purity >= 91.7: print("Accepted") if purity == 99.9: print("Accepted")
9th Jun 2021, 10:17 AM
Alexandru Serbanescu
Alexandru Serbanescu - avatar