is this good?
age = 65
if age <18:
print("Minor LMAO😹")
elif 50<= age <60:
print("Ancient AAAH")
else:
print("Only ashes left💀")
is this good?
age = 65
if age <18:
print("Minor LMAO😹")
elif 50<= age <60:
print("Ancient AAAH")
else:
print("Only ashes left💀")
Good job
give this to dr disrespect it will be helpful
Ironically I did this while starting out in Python as well lmao
If you're 34 it'll print "Only ashes left💀", but the choice itself is fine
if ur age between 18 and 50 it gonna go to the else case
as said before, u need a case for between 18 and 50
The code will not work. Indentation error exists...
age = 65
match age:
case if age < 18:
print("Minor LMAO😹")
case if 50 <= age < 60:
print("Ancient AAAH")
case _:
print("Only ashes left💀")
here you go bud, cleaner code
Naah for such small problem OP's solution is okay. No need for match-case if there aren't any complex conditions.
match case looks cleaner though
Yes that's correct. Though python is more about being optimal!
No it doesn't python code should be written the pythonic way which for such problems, match case just doesn't look good. Also, it is really redundant and only increases the headaches of people looking at the code.
if you try writing this correctly with match-case, you will end up writing if statements within the cases, and at that point you can't call it cleaner
thank you everyone and yes my code does work
https://imgur.com/a/sFfGD1u
https://imgur.com/OO5wpSS
how to fix because the code you paste didn't have the indents. me confuse bro
50 isnt young
Bro got the Drake codebase
This is shit, quit now
most supportive vlr user
Thank you ☺️
this is trash u should be ashamed of yourself
Not bad for a first timer
any programmers out here wanna tell me how to start out with java? any specific courses to learn from?
i got some experience in python and c# but only basics for uni
Udemy course: Learn JAVA Programming - Beginner to Master by Abdul Bari
thnx
you can try using input()