+ 3

Why it's giving error

I entered 78 and it returns me first output kindly checkout and please tell me where I made the mistake https://sololearn.com/compiler-playground/cxxsFZaY7PHw/?ref=app

12th May 2024, 3:21 PM
Noob Coder 🥂
6 Respuestas
+ 7
Noob Coder 🥂 , there is an overlapping in the conditionals that are used: if age <= 18: ... elif age >= 18: both of them cover the age of 18...
12th May 2024, 4:21 PM
Lothar
Lothar - avatar
+ 5
What's the question of your first "if"? Does 78 meet that? (It's not giving an error, it's giving you an answer you don't want. the code works "fine")
12th May 2024, 3:37 PM
Ausgrindtube
Ausgrindtube - avatar
+ 5
Ohh sorry sorry I made a sily mistake but now it works find thanks alot Ausgrindtube and A͢J sir
12th May 2024, 3:49 PM
Noob Coder 🥂
+ 5
Manikandan , your post has *no relation to the question* that has been asked. to avoid confusion, please kindly remove your post.
14th May 2024, 3:51 PM
Lothar
Lothar - avatar
+ 4
Noob Coder 🥂 all good. That's one "error" everyone learns from. Happy coding!
12th May 2024, 8:06 PM
Ausgrindtube
Ausgrindtube - avatar
+ 3
Noob Coder 🥂 78 >= 18 ?
12th May 2024, 3:46 PM
A͢J
A͢J - avatar